mysql 一张表根据另外一张表统计的个数来排序

mysql 一张表根据另外一张表统计的个数来排序,第1张

select t1.shop_id,count(1)

from shop t1 left join goods t2 on t1.shop_id=t2.shop_id

group by t1.shop_id

order by count(1) desc

select commentId, count(status=1) as times from t_like group by commentId order by commentId desc limit 6


欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/zaji/8645187.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-19
下一篇 2023-04-19

发表评论

登录后才能评论

评论列表(0条)

保存