|Subject||Re: Query returns invalid result|
> The intention is to find out the difference between the count ofTry
> rows with P and the count of rows with X, filtered by various
> criteria such as a given DateSbm and/or AccountId.
> Any suggestions on a correct SQL statement?
FROM CLAIMSPAIDREVERSED CPR1 WHERE CPR1.DATESBM>=?
) - (SELECT COUNT(CPR2.CLAIMSTS) FROM
CLAIMSPAIDREVERSED CPR2 WHERE CPR2.DATESBM>=?
AND CPR2.CLAIMSTS='X' AND CPR2.ACCOUNTID=?