SQL WHERE.. IN clause multiple columns

前端 未结 13 1276
死守一世寂寞
死守一世寂寞 2020-11-29 15:56

I need to implement the following query in SQL Server:

select *
from table1
WHERE  (CM_PLAN_ID,Individual_ID)
IN
(
 Select CM_PLAN_ID, Individual_ID
 From CR         


        
13条回答
  •  时光取名叫无心
    2020-11-29 16:12

    I founded easier this way

    Select * 
    from table1 
    WHERE  (convert(VARCHAR,CM_PLAN_ID) + convert(VARCHAR,Individual_ID)) 
    IN 
    (
     Select convert(VARCHAR,CM_PLAN_ID) + convert(VARCHAR,Individual_ID)
     From CRM_VCM_CURRENT_LEAD_STATUS 
     Where Lead_Key = :_Lead_Key 
    ) 
    

    Hope this help :)

提交回复
热议问题