比如对 姓名字段,可以同时查询两个姓名的记录?

解决方案 »

  1.   

    用or就行了
    select * from table1 where [name]='abc' or [name]='123' 
      

  2.   

    select * from table1where name:=p1 or name:='p2';
      

  3.   

    不知你是否说的是有两个记录集的情况,这种情况下可以使用union
    QQ33524826
      

  4.   

    select * from table1where name:=p1
    union
    select * from table1where name:=p1是不是一样的记录出现两次呀。
      

  5.   

    select * rrmo student where name in['张三','李司','王五']
      

  6.   

    select * from 表名称 where 字段名称 in['张三','李司','王五']
    后面也是要根据数据的类型来区分写法的