I need a count by the grouping (index) variables, then re-join that number into the source data, then filter for count > 1. If my source file is 10K records, the output should be 10K records. I need all source columns in the output to analyze if it really is a duplicate record, or if another column needs to be added to the index.

The above query returns NULL for cnt for all records.

If you want a post with sample data to work with just let me know; I thought the above sufficient to explain the issue.

I need a count by the grouping (index) variables, then re-join that number into the source data, then filter for count > 1. If my source file is 10K records, the output should be 10K records. I need all source columns in the output to analyze if it really is a duplicate record, or if another column needs to be added to the index.

The above query returns NULL for cnt for all records.

If you want a post with sample data to work with just let me know; I thought the above sufficient to explain the issue.

Thanks...

Hi,

your idea is correct; you have just made a "typo". You perform the grouping in the nested query and not in the main query. Thus you can't use HAVING in the main query.

So: Just change the last row of your query to use a WHERE instead and it will work properly.