2021-04-25
閱讀量:
793
mysql限制查詢結(jié)果數(shù)量:查詢?yōu)g覽量最低的5個商品?
-- 限制查詢結(jié)果數(shù)量 -- 查詢?yōu)g覽量最高的前5個商品 select item_id,sum(behavior_type='pv') as 瀏覽量 from userbehavior group by item_id order by 瀏覽量 desc limit 5; select item_id,sum(behavior_type='pv') as 瀏覽量 from userbehavior group by item_id order by 瀏覽量 desc limit 0,5;
問題:如果是查詢?yōu)g覽量最低的5個商品呢?
回復(fù):






評論(0)


暫無數(shù)據(jù)
推薦帖子
0條評論
1條評論
0條評論