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.
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.
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)