我有两张表,一张是:usercode      fullname       jsmodel(表名:inhouse)
                     0001           内科            0
          第二张是:usercode     fullname      inhouseusercode(表名:doctor)
                      0001         黄药师            0001
要用一条SQL语句实现以下功能:
   当知道第二张表(doctor)的Fullname 为"黄药师"时,要求能显示出第一张表(inhouse)的Fullname的值(内科).(注意;只用一条SQL 语句实现);

解决方案 »

  1.   

    select a.fullname from inhouse a, doctor b
     where a.usercode = b.usercode
       and b.fullname = '黄药师'
      

  2.   

    select a.fullname,b.fullname from inhouse a,doctor b where a.uesrcode=b.usercode
      

  3.   

    select inhouse.fullname from inhouse,doctor
     where inhouse.usercode=doctor.usercode and doctor.fullname='黄药师'
      

  4.   

    selectn i.fullname from inhouse i,doctor d where d.funame='黄药师''
      

  5.   

    select b.fullname from doctor a  inner join inhouse b on a.usercode=b.usercode
    where a.fullname='黄药师'
      

  6.   

    select a.fullname
    from inhouse a, doctor b
     where a.usercode = b.inhouseusercode
       and b.fullname = '黄药师'
      

  7.   

    select a.fullname from inhouse a, doctor b
     where a.usercode = b.inhouseusercode
         and b.fullname = '黄药师'