拜托拜托,从来没有接触过sql,在线急等

解决方案 »

  1.   

    SELECT b.UPC FROM A a, B b WHERE a.ST1 = b.ST2 AND a.COL1 = b.COL2 AND a.SIZ1 = b.SIZ2
      

  2.   

    select b.UPC from a表 as a left join b表 as b on a.ST1=b.ST2 and a.COL1=b.COL2 and a.SIZ1=b.SIZ2
      

  3.   

    create table excelA(ST1 varchar(20),COL1 varchar(20),SIZ1 varchar(20))create table excelB(ST2 varchar(20),COL2 varchar(20),SIZ2 varchar(20),UPC varchar(20))insert excelA
    select 'a','b','c'
    union all
    select 'aa','bb','cc'
    union all
    select 'aaa','bbb','ccc'insert excelB
    select 'a','b','c','first'
    union all
    select 'aa','bb','dd','second'
    union all
    select 'aaa','bbb','ccc','third'
    union all
    select 'as','bs','cs','forth'
    select b.UPC from excelA as a , excelB as b
    where a.ST1=b.ST2 and a.COL1=b.COL2 and a.SIZ1=b.SIZ2
      

  4.   

    select B.UPC from A join B on A.ST1=B.ST2 and A.COL1=B.COL2 and A.SIZ1=B.SIZ2
      

  5.   

    查询结果:
    UPC
    first
    third
      

  6.   

    SELECT b.UPC FROM A a, B b WHERE a.ST1 = b.ST2 AND a.COL1 = b.COL2 AND a.SIZ1 = b.SIZ2
      

  7.   

    有俩excel表A和B,A中3个字段ST1,COL1,SIZ1;B中四个字段ST2,COL2,SIZ2,UPC;想要实现当ST1=ST2,COL1=COL2,SIZ1=SIZ2时返回值UPC,用SQL语言怎么实现呢?拜托各位大虾,帮帮忙,在线急等!
    select A.UPC from A,B,C where A.ST1=B.ST2  AND  A.COL1=B.COL2 AND A.SIZE1=B.SIZE2