Using IN with sets of tuples in SQL (SQLite3)

Posted by gotgenes on Stack Overflow See other posts from Stack Overflow or by gotgenes
Published on 2010-04-08T01:22:03Z Indexed on 2010/04/08 1:23 UTC
Read the original article Hit count: 364

Filed under:
|

I have the following table in a SQLite3 database:

CREATE TABLE overlap_results (
neighbors_of_annotation varchar(20),
other_annotation varchar(20),
set1_size INTEGER,
set2_size INTEGER,
jaccard REAL,
p_value REAL,
bh_corrected_p_value REAL,
PRIMARY KEY (neighbors_of_annotation, other_annotation)
);

I would like to perform the following query:

SELECT * FROM overlap_results WHERE 
(neighbors_of_annotation, other_annotation)
IN (('16070', '8150'), ('16070', '44697'));

That is, I have a couple of tuples of annotation IDs, and I'd like to fetch records for each of those tuples. The sqlite3 prompt gives me the following error:

SQL error: near ",": syntax error

How do I properly express this as a SQL statement?

© Stack Overflow or respective owner

Related posts about sql

Related posts about sqlite