SQL Query with NOT LIKE IN

前端 未结 8 724
长发绾君心
长发绾君心 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:23

    If you have set of words which you want to include/exclude in search from a particular column. You may want to use regular expression function of mysql.

    Exclude set of words from a column :

    SELECT
      *
    FROM
      Table1
    WHERE
          EmpPU NOT REGEXP 'CSE|ECE|EEE';
    

    Search set of words from a column :

    SELECT
      *
    FROM
      Table1
    WHERE
          EmpPU REGEXP 'CSE|ECE|EEE';
    

提交回复
热议问题