mysql 取所有分类下前N条记录
SELECT * FROM tb_item AS T WHERE 1>(
SELECT COUNT(id)
FROM tb_item WHERE
`item_category_id`=T.`item_category_id` AND id>T.id)
SELECT * FROM tb_item AS T WHERE 1>(
SELECT COUNT(id)
FROM tb_item WHERE
`item_category_id`=T.`item_category_id` AND id>T.id)
评论已关闭