i want to check if any customer has more than 1 same insplanid_FK.
;with cte as
(
SELECT *,
count(cusid_FK) OVER (partition by cusid_FK,ccardholdername,insplanid_FK) as V_COUNT
FROM cusinsplan
WHERE ISNULL(insplanid_FK,'')!=''
)
select * from cte where V_COUNT>1
Comments
Post a Comment