SQL In Clause Multiple Columns

in-clause, in-operator, multiple-columns, sql

Solution

How about this?

SELECT
    *
FROM
    Tabl tabb
WHERE
    (tabb.col1 = 1 AND tabb.col2 = 2) OR
    (tabb.col1 = 3 AND tabb.col2 = 4)

Problem

``` SELECT * FROM Tabl tabb WHERE (tabb.col1, tabb.col2) IN ( (1,2), (3,4)) ``` The above works in Oracle but I am trying to run in a proprietary SQL engine which doesn't support the above query formation with multiple columns in IN. I am trying to find combinations of 1,2 and 3,4 in the DB. Please help me with any alternatives for achieving the above. I am looking for ways to pass a list of values for col1 and col2 from Java at one shot, so '=' might not be an option as it might require two SQL statements for achieving the above.

Original source