select a.id,count1=isnull(b.count1,0),count2=isnull(c.count2,0) from tb1 a left join tb2 b
on a.id=b.id
left join tb3 c
on a.id=c.id

解决方案 »

  1.   

    select a.id,count1=isnull(b.count1,0),count2=isnull(c.count2,0) 
    from ta a
    left join tb b on a.id=b.id
    left join tc c on a.id=c.id
      

  2.   

    select 
       a.id,
       count1=isnull(b.count1,0),
       count2=isnull(c.count2,0) 
    from ta a
       left join tb b 
            on a.id=b.id
       left join tc c 
            on a.id=c.id
      

  3.   

    select 
       a.id,
       count1=isnull(b.count1,0),
       count2=isnull(c.count2,0) 
    from ta a
       left join tb b 
            on a.id=b.id
       left join tc c 
            on a.id=c.id
      

  4.   

    select a.id,count1=isnull(b.count1,0),count2=isnull(c.count2,0) from 表1 a
       left join 表2 b on a.id=b.id
       left join 表3 c on a.id=c.id
      

  5.   

    select a.id,count1=isnull(b.count1,0),count2=isnull(c.count2,0) from 表1 a
       left join 表2 b on a.id=b.id
       left join 表3 c on a.id=c.id
      

  6.   

    好象left join 只能用于两张表啊?