jQuery火箭图标返回顶部代码 - 站长素材

mysql分组取前5,类似sql server的partition by

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

 

posted @ 2021-03-30 17:35  bingco  阅读(264)  评论(0编辑  收藏  举报