I am trying this code:
SELECT Email FROM
(SELECT Email, COUNT(Email) AS cnt
FROM Person
GROUP BY Email
HAVING cnt(*) >1 )
for this question:
Not sure what I am getting wrong?
Here's the error I receive:
Runtime Error Message: Line 6: SyntaxError: near '*) >1 )'
Last executed input: {"headers": {"Person": ["Id", "Email"]}, "rows": {"Person": []}}
Answer
select email
from person
group by email
having count(*)>1
You don't need the nested queries for what you want.
No comments:
Post a Comment