请问 ,我现在有4个表,分别是表A 表B 表C 表D,这4个表中都ST这个字段,请问,我怎么用一个SQL语句查出这4个表中ST这个字段相同的数据。在线等,摆脱大家了 ,我是新手!

解决方案 »

  1.   

    select a.*,b.*,c.*,d.* from a,b,c,d
    where a.st=b.st and b.st-=c.st and c.st=d.st
      

  2.   

    select a.st
    from a ,b,c,d
    where a.st=b.st and a.st=c.st and a.st=d.st;
      

  3.   

    select a.st
    from a ,b,c,d
    where a.st=b.st and a.st=c.st and a.st=d.st;这种写法已经很好了,但要注意的是你要已那个表作为主表,为了性能最好用记录少的表