Published on InterSystems Developer Community (https://community.intersystems.com)

Home > SQL with 2 columns in where condition

Question
Natasa Klenovsek Arh · Jan 31, 2017

SQL with 2 columns in where condition

I'm having trouble creating a view in cache with query like:

 

SELECT column1, column2, column 3
    FROM  table
    WHERE
        (column1, columnn 2) IN (SELECT c1, c2 FROM table2 GROUP BY c1)
    ORDER BY column1

 

I think the problem is in where clause, because it cannot take two columns .

 

the exact error: [SQLCODE: <-1>:<Invalid SQL statement>] [%msg: < ) expected, , found^ (column1,>]

 

Any idea on how to solve this?

 

Thank you.

#Caché

Source URL:https://community.intersystems.com/post/sql-2-columns-where-condition