SELECT a.email
FROM (
SELECT email, COUNT(*) AS count_num
FROM Person
GROUP BY email
) AS a ## ํ์
WHERE a.count_num >= 2
;
SQL
๋ณต์ฌ
๋ชจ๋ ์๋ธ์ฟผ๋ฆฌ ํ
์ด๋ธ๋ค์ Alias๊ฐ ๋ถ์ด์ผ ํ๋ค
group by๋ก ์ฐ์ฐ๋ ์นผ๋ผ์ ๊ณ์ฐ โ having
SELECT email, count(id) as cnt
FROM Person
GROUP BY Email
HAVING COUNT(id) >= 2
;
SQL
๋ณต์ฌ