例如:
【table1】有   name(Key)   ID_Card(Key)   age               birthday  4个字段
【table2】有   name(key)   ID_Card(key)   country(国家)   state(州)     4个字段
关键字都是表示同一个人请问如果要筛选,【满足所有是 country国家人的             age 和birthday 】或 
                【满足所有是 country国家中state州的人的  age 和 birthday】请问这2个筛选语句怎么写?先谢谢了~
还有这个表只是这样的形式,我只是举例~

解决方案 »

  1.   

    select table1.age,table1.birthday from table1,table2 where table1.ID_Card = table2.ID_Card and country = 'China'
      

  2.   

    select  a.age, a.birthday from table1 as a
    join table2 as b
    where a.name = b.name and a.id_card = b.id_card
      

  3.   

    select  a.age, a.birthday from table1 as a 
    join table2 as b 
    on a.name = b.name and a.id_card = b.id_card
      

  4.   


    select  name, ID_Card, age, birthday 
    from    table1
    where   table1.ID_Card = (select ID_Card 
                              from   table2
                              where  country = 'China')我以前这样做,提示:【子查询最多能返回一个记录】
    请问按照我的想法,有别的方法吗?谢谢了……
      

      

  5.   


    tabby!!!!!!!!!
    sooooooooooooooo powerful you are ~
      

  6.   

    为什么我结贴了
    但是看不到给的分了……?
    tabby90分,其余的给了bestwolf_yan