sql >> Base de Datos >  >> RDS >> Sqlserver

SQL WHERE.. IN cláusula múltiples columnas

En su lugar, querrá usar la sintaxis WHERE EXISTS.

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)