Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
select ch.file_ID, COUNT (*) from OPID_POSTPAY_BCBSNE_CORELINK_PURGE_ORIG.CLAIM_HISTORY ch INNER JOIN ( SELECT DISTINCT OPID_POSTPAY_BCBSNE_CORELINK_PURGE.CLM_KY FROM OPID_POSTPAY_BCBSNE_CORELINK_PURGE.PURGE_STRIP WHERE OPID_POSTPAY_BCBSNE_CORELINK_PURGE.[FILE_ID] = 41552 and OPID_POSTPAY_BCBSNE_CORELINK_PURGE.HST_FG = 1 ) ct on ch.CLM_KY = ct.CLM_KY Group by ch.FILE_ID
Then the query would be:
INSERT INTO #CLAIM_TEMP (CLM_KY) SELECT DISTINCT CLM_KY FROM PURGE_STRIP WHERE [FILE_ID] = @fileId and HST_FG = 1
FROM CLAIM_HISTORY ch WITH(NOLOCK) INNER JOIN #CLAIM_TEMP ct on ch.CLM_KY = ct.CLM_KY
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.