题解 | 下单最多的商品
下单最多的商品
https://www.nowcoder.com/practice/d7c93e3a3d5b4087896539121d32d367
SELECT product_id, COUNT(trace_id) AS cnt FROM user_client_log WHERE step = "order" GROUP BY product_id ORDER BY cnt DESC, product_id LIMIT 1
下单最多的商品
https://www.nowcoder.com/practice/d7c93e3a3d5b4087896539121d32d367
SELECT product_id, COUNT(trace_id) AS cnt FROM user_client_log WHERE step = "order" GROUP BY product_id ORDER BY cnt DESC, product_id LIMIT 1
相关推荐