SQL Query with NOT LIKE IN

前端 未结 8 684
长发绾君心
长发绾君心 2020-12-05 17:15

Please help me to write a sql query with the conditions as \'NOT LIKE IN\'

Select * from Table1 where EmpPU NOT Like IN (\'%CSE%\', \'%ECE%\', \'%EEE%\')
         


        
8条回答
  •  伪装坚强ぢ
    2020-12-05 17:30

    you cant combine LIKE and IN

    you can do:

    select * from Table1
    where EmpPU not in ('%CSE%', '%ECE%', '%EEE%')
    

    but you wont benefit from the % wildcard

    if you need the % the only option is:

    Select * from Table1
    where EmpPU not like '%CSE%' and  EmpPU not like '%ECE%' and EmpPU not like '%EEE%'
    

提交回复
热议问题