TA贡献1784条经验 获得超9个赞
select a.id, (select count(*) from b where b.aid = a.id) c
from a
order by c asc|desc
TA贡献1946条经验 获得超3个赞
select * from a order by (select Id,count(*) as count from b group by Id);试试!!!
10+年DBA老司机带你轻松玩转 SQL
¥ 48.00
举报
购课补贴联系客服咨询优惠详情
慕课网APP您的移动学习伙伴
扫描二维码关注慕课网微信公众号