How do I add multiple "NOT LIKE '%?%' in the WHERE clause of sqlite3?

前端 未结 7 2141
无人及你
无人及你 2020-12-23 20:06

I have a sqlite3 query like:

SELECT word FROM table WHERE word NOT LIKE \'%a%\';

This would select all of the words where \'a\' does not oc

7条回答
  •  情歌与酒
    2020-12-23 20:36

    If you use Sqlite's REGEXP support ( see the answer at Problem with regexp python and sqlite for how to do that ) , then you can do it easily in one clause:

    SELECT word FROM table WHERE word NOT REGEXP '[abc]';
    

提交回复
热议问题