select * from ( select if(@utype = a.utype, @nu := @nu+1, @nu:=1) as nu, @utype := a.utype, a.* from secuser a order by a.utype,a.id desc ) T where T.nu <= 5
2021-08-11 08:38:40
select * from ( select if(@utype = a.utype, @nu := @nu+1, @nu:=1) as nu, @utype := a.utype, a.* from secuser a order by a.utype,a.id desc ) T where T.nu <= 5
下一篇:JDBC