It worked normally in Oracle SQL, but it does not work in ANSI SQL.
SELECT whatever WHERE (col1,col2) IN ((val1, val2), (val1, val2), ...)
How do I write code in ANSI SQL (IMPALA SQL)?
I don't want the following code because there are many lists.
WHERE (col1 = val1a AND col2 = val2a)
OR (col1 = val1b AND col2 = val2b)
...
thank you!
(ex) https://dba.stackexchange.com/questions/34266/selecting-where-two-columns-are-in-a-set
We can do smooth operation in ANSI sql.
This isnt possible in hive or impala. Only 'other' workaround is concat().
You can use below sql-
Pls note if col1/col2 is null, it wont be matched.
EDIT : this can have severe performance problem. So, you can store val1,val2 in a static/lookup table and then use it to join with main table like this -
You also have flexibility to change values as per future need and not change the sql.