表一:table1
字段:a,b,c,date
表二:table2
字段:b,e
表一:table3
字段:c,f
要求查date='20110911'字段a,f的值
请大家帮帮忙,谢谢!

解决方案 »

  1.   

    select
      a.a,c.f
    from
      table1 a,table2 b,table3 c
    where
      a.b=b.b
    and
      a.c=c.c
    and
      b.data='20110911'
      

  2.   

    select a,f from table1,table3 where table1.c=table3.c and table1.[date]='20110911'
      

  3.   

    select 
    a.a,c.f
    from table1 a
    inner join table2 b on a.b=b.b
    inner join table3 c on a.c=c.c
    where a.[date]='20110911'同時table2也要作為條件
      

  4.   

    不好意思写错了,应该是:
    表一:table1
    字段:a,b,c,date
    表二:table2
    字段:b,e
    表一:table3
    字段:e,f
    要求查date='20110911'字段a,f的值
    请大家帮帮忙,谢谢!
      

  5.   


    select 
    a.a,c.f
    from table1 a
    inner join table2 b on a.b=b.b
    inner join table3 c on b.e=c.e
    where a.[date]='20110911'