Categories

Tags

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

select * from goods a where 
(select count(id) from goods b where b.c_id=a.c_id and b.id>a.id) <3