Reputation: 147
I have a table like this:
Id Name
1 Test1
2 Test2
3 Test3
And I have a string like 'Test1Test2' So I want records that Name not in that string like Test3. How can I get this row in sqlite?
Upvotes: 1
Views: 40
Reputation: 57103
You can use either the instr core function e.g.
SELECT * FROM thetable WHERE instr('Test1Test2',name) < 1;
Or you could use LIKE e.g.
SELECT * FROM thetable WHERE NOT ('Test1Test2' LIKE '%'||name||'%');
The LIKE, GLOB, REGEXP, and MATCH operators
Upvotes: 1