Re: [sqlite] LIKE IN

2019-11-25 Thread Gert Van Assche
27;s anything at all that matches, > then go with exists. > > > > -Original Message- > From: sqlite-users On > Behalf Of Gert Van Assche > Sent: Saturday, November 23, 2019 5:43 AM > To: SQLite mailing list > Subject: Re: [sqlite] LIKE IN > >

Re: [sqlite] LIKE IN

2019-11-25 Thread David Raymond
matches. So if you want any info from the queries table then go with the join route, if you only care if yes/no there's anything at all that matches, then go with exists. -Original Message- From: sqlite-users On Behalf Of Gert Van Assche Sent: Saturday, November 23, 2019 5:43 A

Re: [sqlite] LIKE IN

2019-11-23 Thread Gert Van Assche
Both queries will work like this: DROP TABLE names; CREATE TABLE names (name TEXT); INSERT INTO names VALUES ('Alex'); INSERT INTO names VALUES ('Alexander'); INSERT INTO names VALUES ('Alexandra'); INSERT INTO names VALUES ('Rob'); INSERT INTO names VALUES ('Rhobin'); -- should not match INSERT I

Re: [sqlite] LIKE IN

2019-11-23 Thread Gert Van Assche
I think this will work: INSERT INTO queries VALUES ('Alex'); INSERT INTO queries VALUES ('Rob'); select * from names where exists ( select query from queries where names.name like '%'||query||'%' ); On Fri, 22 Nov 2019 at 15:19, David Raymond wrote: > Or alternatively something like: >

Re: [sqlite] LIKE IN

2019-11-22 Thread David Raymond
Or alternatively something like: select * from table where exists ( select query from queries where table.name like query ); ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listin

Re: [sqlite] LIKE IN

2019-11-22 Thread Simon Davies
Hi, On Fri, 22 Nov 2019 at 13:18, Hamish Allan wrote: > > Hi, > > Is it possible to achieve the effect of combining the LIKE and IN operators? > > So for instance if I have tables: > > CREATE TABLE names (name TEXT); > INSERT INTO names VALUES ('Alexandra'); > INSERT INTO names VALUES ('Rob'); >