要求输入框里任意输入姓名或者代码 都可以查询出来  求大师解答

解决方案 »

  1.   

    select * from 表名 where 姓名 like '%值%' or 代码 like '%值%'
      

  2.   

    select * from table1 t1 left join table2 t2 on t1.name=t2.sex where s.name like '%王%'
      

  3.   


    select * from table1 t1 left join table2 t2 on t1.t2Id=t2.id where s.name like '%王%' 
      

  4.   

    select * from table1 t1 left join table2 t2 on t1.name=t2.sex where s.name like '%王%'  or ......其他條件 
      

  5.   

    select * from 表 where 姓名 + 代码 like '%传入值%'
      

  6.   

    SELECT * from
    experts e,sx s,classification c where e.e_id=s.e_id1 and s.cl_id1= c.cl_id and e.e_name LIKE '%张%'
      

  7.   

    select a.字段1,a.字段2,a.字段3,b.字段1,b.字段2,c.字段1
    from  table1  a 
    left join  table2 b on a.关联字段=  b.关联字段
    left join  table3 c on a.关联字段=  c.关联字段
    where a.字段1 like '%模糊值%' or a.字段2 like '%模糊值%'