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
>
>
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
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
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:
>
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
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');
>
6 matches
Mail list logo