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');

CREATE TABLE matches (match TEXT);
INSERT INTO matches VALUES ('Alex');
INSERT INTO matches VALUES ('Alexander');
INSERT INTO matches VALUES ('Alexandra');
INSERT INTO matches VALUES ('Rob');
INSERT INTO matches VALUES ('Robin');
INSERT INTO matches VALUES ('Robert');

I can query as follows:

SELECT * FROM names WHERE name IN (SELECT * FROM matches);

But can I do something more like:

CREATE TABLE queries (query TEXT);
INSERT INTO queries VALUES ('Alex%*');
INSERT INTO queries VALUES ('Rob%*');

SELECT * FROM table WHERE name LIKE IN (SELECT * FROM queries);

Thanks,
Hamish
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to