sql取出商品表每个类别的前3条记录

来源:互联网 发布:windows命令 编辑:程序博客网 时间:2024/06/06 02:40
select * from goods a where
(select count(id) from goods b where b.c_id=a.c_id and b.id>a.id) <3
0 0