Consider following data in table ->
1 example@hotmail.com
2 example12@hotmail.com
3 example@hotmail.com
4 example@hotmail.com
I want it to return only the following:
2 example12@hotmail.com
...and skip the duplicate values.
答案 0 :(得分:2)
The query you want is
SELECT id, email, whatEverColumn
FROM table
WHERE email IN (SELECT email
FROM table
GROUP BY email
HAVING COUNT(id) = 1)
答案 1 :(得分:2)
Group by email and add having count(email) = 1