SQL Query to find duplicates not returning any results
- by TheDudeAbides
I know there are duplicate account numbers in this table, but this query returns no results.
SELECT [CARD NUMBER],[CUSTOMER NAME],[ACCT NBR 1],[ACCT NBR 2],
COUNT([ACCT NBR 1]) AS NumOccurences
FROM DebitCardData.dbo.['ATM Checking Accts - Active$']
GROUP BY [CARD NUMBER],[CUSTOMER NAME],[ACCT NBR 1],[ACCT NBR 2]
HAVING (COUNT([ACCT NBR 1])1)