Try:
Select a.Type,(Select IsNull(count(*),0) from Tab_售出 b where b.type = a.type ),
(Select IsNull(count(*),0) from 反修 c where c.type = a.type )
from Tab_车形 a

解决方案 »

  1.   

    Select a.Type,
    (Select IsNull(count(b.*),0) ,
    (Select IsNull(count(c.*),0) 
    from Tab_车形 a,反修 c  Tab_售出 b 
    where b.type = a.type AND  c.Number = b.Number )
    没问题的
    你试试!
      

  2.   

    select a.type, count(b.number) 卖出 ,count(c.number) 反修
    from Tab_车形 a left join tab_售出  b on a.type=b.type
    left join 反修 c on b.number=c.number
    group by a.type
      

  3.   

    Select A.Type Type,
    (Select count(B.type)  from B group by Type)卖出,
    (Select Count(B.type) from B,C Where B.Number=C.Number Group By B.type) 反修 
    from 表A A,表B B,表C C Where A.type=B.type and B.number=C.number
      

  4.   

    多谢happydreamer,按你的方法我作出了. 别人的方法都得不到结果,不知道为什么...
    想问一下happydreamer,你这个方法有名称吗? 我对sql不熟, 这个 Tab_反修是起什么作用的?
      

  5.   

    "反修 c"中的“c”是表“反修”的别名不用别名也可以这样:
    select Type,(select count(*) from Tab_售出 where Type=Tab_车形.Type) as 卖出,(select count(*) from 反修 where Type=Tab_车形.Type) as 反修 from Tab_车形