I have a table FOO with the following definition:
id INTEGER,
type INTEGER,
data VARCHAR(32),
PRIMARY KEY(id, type)
I am given a list of pairs: (id, type) and I want to get all of the data which corresponds to those pairs (along with the id and type so I know what belongs to what). Can I do this in one query? (My specific dialect of SQL is SQLite)
The only way to do this in SQLite is to do a bunch of
orstatements in awhereclause. Or, you can do this:For edification, the
whereclause approach is: