Sqlserver
 sql >> Datenbank >  >> RDS >> Sqlserver

SQL WHERE.. IN-Klausel mehrere Spalten

Verwenden Sie stattdessen die WHERE EXISTS-Syntax.

SELECT *
FROM table1
WHERE EXISTS (SELECT *
              FROM table2
              WHERE Lead_Key = @Lead_Key
                        AND table1.CM_PLAN_ID = table2.CM_PLAN_ID
                        AND table1.Individual_ID = table2.Individual_ID)