I want to select rows that have a distinct email
, see the example table below:
+----+---------+-------------------+-------------+
| id | title | email | commentname |
+----+---------+-------------------+-------------+
| 3 | test | [email protected] | rob |
| 4 | i agree | [email protected] | rob |
| 5 | its ok | [email protected] | rob |
| 6 | hey | [email protected] | rob |
| 7 | nice! | [email protected] | simon |
| 8 | yeah | [email protected] | john |
+----+---------+-------------------+-------------+
The desired result would be:
+----+-------+-------------------+-------------+
| id | title | email | commentname |
+----+-------+-------------------+-------------+
| 3 | test | [email protected] | rob |
| 7 | nice! | [email protected] | simon |
| 8 | yeah | [email protected] | john |
+----+-------+-------------------+-------------+
Where I don't care which id
column value is returned.
What would be the required SQL?