A SAS administrator wants to use PROC SQL to identify duplicate customer records based on email address. Which approach correctly identifies duplicate email addresses?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — b is correct because GROUP BY email aggregates rows by email address, and HAVING COUNT(*) > 1 filters to only groups with more than one row, identifying duplicates. A is wrong because GROUP BY is missing and the HAVING clause references an alias (cnt) which is not valid in PROC SQL HAVING without the GROUP BY.
Full explanation below image
Full Explanation
B is correct because GROUP BY email aggregates rows by email address, and HAVING COUNT(*) > 1 filters to only groups with more than one row, identifying duplicates. A is wrong because GROUP BY is missing and the HAVING clause references an alias (cnt) which is not valid in PROC SQL HAVING without the GROUP BY. C is wrong because WHERE cannot contain aggregate functions. D is wrong because HAVING without GROUP BY is invalid.