1.找出gdfile2003里所有的记录;
2.gdfile中所有在gdfile2003里出现了的.
select * from gdfile2003
union all
select * from gdfile as A where exists (select * from gdfile2003 where id like A.id+'%' )

解决方案 »

  1.   

    1.找出gdfile2003里所有的记录;
    2.gdfile中所有在gdfile2003里出现了的.
    select * from gdfile2003
    union all
    select * from gdfile as A where exists (select * from gdfile2003 where id like A.id+'%' )
      

  2.   

    select * from gdfile2003
    union all
    select gdfile.* from gdfile inner jion gdfile2003 on id like A.id+'%'
      

  3.   

    我这么写有问题吗?
    select * from gdfile as a where exists (select * from gdfile2003 where gd_code like a.gd_code+'%' and gd_com='060401')