Given a table foo with a composite primary key (a,b) , is there legal syntax for writing a query, for example:
SELECT ... FROM foo WHERE a,b IN (SELECT ...many tuples of a/b values...); UPDATE foo SET ... WHERE a,b IN (SELECT ...many tuples of a/b values...);
If this is not possible and you cannot change the circuit, how could you fulfill the equivalent above?
I am also going to use the terms "composite primary key", "subheading", "subselect" and "subquery" here to search for these aliases.
Edit : I'm interested in the answers for standard SQL, as well as those that will work with PostgreSQL and SQLite 3.
sql subquery composite-primary-key
Phrogz Jan 07 2018-11-11T00: 00Z
source share