Can someone please tell me why the Select Count(*) and the Delete transaction return a different number of records?
I would like to have some confidence in my numbers before I delete them.
Here's the statement I'm using:
Begin Tran
--Select Count (*) --returns 177,145 records
Delete c -- returns 137,992 records
From IncurredHCFAClaims c
LEFT JOIN IncurredHCFAClaims c2
ON c.PatID=c2.PatID
AND c.Patient=c2.Patient
AND c.Diag1=c2.Diag1
AND c.Tax_ID=c2.Tax_ID
AND c.ServiceDate=c2.ServiceDate
AND c.TCharg=c2.TCharg
AND c.HCPCS=c2.HCPCS
AND c.Units=c2.Units
AND c.POS=c2.POS--177145
WHERE c.Claim_Number <c2.Claim_Number
Rollback Tran
Rollback Tran
Thanks!
I would like to have some confidence in my numbers before I delete them.
Here's the statement I'm using:
Begin Tran
--Select Count (*) --returns 177,145 records
Delete c -- returns 137,992 records
From IncurredHCFAClaims c
LEFT JOIN IncurredHCFAClaims c2
ON c.PatID=c2.PatID
AND c.Patient=c2.Patient
AND c.Diag1=c2.Diag1
AND c.Tax_ID=c2.Tax_ID
AND c.ServiceDate=c2.ServiceDate
AND c.TCharg=c2.TCharg
AND c.HCPCS=c2.HCPCS
AND c.Units=c2.Units
AND c.POS=c2.POS--177145
WHERE c.Claim_Number <c2.Claim_Number
Rollback Tran
Rollback Tran
Thanks!