A
classid part phone
50 市场部 0
51 辽宁 8
52 山东2 8
54 技术部 0
55 河北 8
56 内蒙古 8
58 广东 9B
userid num pwd
8 22 1
9 33 2
10 44 3C
userid name classid
9 黄艳明 67
9 JOJO 54
9 zhok 54
9 zhou 54
9 zzzz 50
9 jesse 51
10 liev 50
根据表A phone=0 和表B userid=9 从表C中查询出 
9 JOJO 54
9 zhok 54
9 zhou 54
9 zzzz 50

解决方案 »

  1.   

    select b.userid,c.name,a.phone
    from a
      inner join b
     on a.phone=b.userid
      inner join c
     on a.classid=c.classid
      

  2.   

    select c.userid , c.name , c.classid from C,B,A where c.userid = b.userid and b.userid = 9 and a.phone = 0 and a.classid = c.classid
      

  3.   


    select b.userid,c.name,a.phone
    from a, b ,c
    where a.phone=b.userid and a.classid=c.classid
     and a.phone=0 and b.userid=9
      

  4.   


    select c.* from a, b ,c
    where a.phone=b.userid and a.classid=c.classid
     and a.phone=0 and b.userid=9