Sqlserver
 sql >> Base de données >  >> RDS >> Sqlserver

SQL WHERE.. IN clause plusieurs colonnes

Vous voudrez utiliser la syntaxe WHERE EXISTS à la place.

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)