select a.cardtype ,sum(a.kcNum),sum(b.rknum),sum(c.chkNum) from kc a,chk b,rk c where a.cardtype =+ b.cardtype and a.cardtype =+ c.cardtype
group by kc.cardtype

解决方案 »

  1.   

    试试:
    select t1.cardtype,kcNum=isnull(sum(t1.kcNum),0),rkNum=isnull(sum(t2.rkNum),0),chkNum=isnull(sum(t3.chkNum),0)
    from kc t1 left join rk t2 on t1.cardtype=t2.cardtype
               left join chk t3 on t1.cardtype=t3.cardtype
    group by t1.cardtype
    order by t1.cardtype
      

  2.   

    好,可是我没SQL,看看能不能找到安装盘~
      

  3.   

    可不可以麻烦大家给点小题目让我做做,数据库方面的,
    我现在还没工作,但马上就要工作了!!!
    [email protected]
      

  4.   

    多谢 supsuccess(火气不小) 和scottwhb(jack) ,问题解决,我想了一天都没头脑的问题二位如此简单解决,看来要当好程序员还是要少打游戏多问多交流多写程序:)to wangjing1997(wangjing1997)
    我是拨号呀,下载会死的!还好找到了mssql7的盘~