SELECT * FROM table a LEFT JOIN (SELECT key,count(*) as c FROM table GROUP BY key ) b on a.key=b.key ORDER BY c desc
本文共 170 字,大约阅读时间需要 1 分钟。
SELECT * FROM table a LEFT JOIN (SELECT key,count(*) as c FROM table GROUP BY key ) b on a.key=b.key ORDER BY c desc
转载于:https://www.cnblogs.com/CaptainLin/p/4205839.html