本帖最后由 Xy_SuperMario 于 2011-06-21 15:57:51 编辑

解决方案 »

  1.   

    select A.cid,count(1) as total from A
       inner join B on A.cid = B.cid
    group by A.cid order by total desc 
      

  2.   

    http://topic.csdn.net/u/20080110/12/17479e6a-7161-4a2a-b077-71f5661f1397.html
      

  3.   

    select B.* from B ,(
    select cid,count(*) as num from A group by cid)AA where AA.cid=B.cid order by AA.num desc
      

  4.   

    select t2.fen,t2.cid from B t inner join A t2 on t.cid=t2.cid order by t2.cid desc
      

  5.   

    我实现类似这样的select cid,fen from B order by  select cid from(select count(cid)....)desc.
    这样能不能实现啊?
      

  6.   

    按 A.cid 出现的个数降序?
    select B.* from b, (select cid, count(*) as cnt from A group by cid) c where B.cid=c.cid order by c.cid desc