select A_id,name,tel,home,case when c_id is null then 1 else 0 end num 
from A left join B on a_id=b_id left join C on a_id=c_id

解决方案 »

  1.   

    select a.A_id ,a.name a.tel b.home ,(case  c.hup when null then '1' else '0' end) as num
    form ...................
      

  2.   

    C表与A,B的关联条件是什么?A_id 关联 B_id
    C表字段 C_id 存的是A_id的值
      

  3.   

    select a.A_id ,a.name a.tel b.home ,(case  c.hup when null then '1' else '0' end) as num
    form a a 
    left join b b on a.a_id=b.a_id
    left join c c on c.a_id=c.a_id
      

  4.   

    select A_id,name,tel,home,(case when C_id is null then 0 else 1 end)num 
    from A,B
    left join C on C_id=A_id
    where A_id=B_id