我想选择具有 distinct email
的行,请参见下面的示例表:
+----+---------+-------------------+-------------+
| id | title | email | commentname |
+----+---------+-------------------+-------------+
| 3 | test | rob@hotmail.com | rob |
| 4 | i agree | rob@hotmail.com | rob |
| 5 | its ok | rob@hotmail.com | rob |
| 6 | hey | rob@hotmail.com | rob |
| 7 | nice! | simon@hotmail.com | simon |
| 8 | yeah | john@hotmail.com | john |
+----+---------+-------------------+-------------+
预期的结果将是:
+----+-------+-------------------+-------------+
| id | title | email | commentname |
+----+-------+-------------------+-------------+
| 3 | test | rob@hotmail.com | rob |
| 7 | nice! | simon@hotmail.com | simon |
| 8 | yeah | john@hotmail.com | john |
+----+-------+-------------------+-------------+
我不关心返回哪个 id
列值。
所需的 SQL 是什么?