Public feed #531285

MySQL disctinct

public text v1 · immutable
Raw Edit
·published 2007-06-02 12:48 UTC
rendered paste body
mysql> select distinct rc_title,rc_comment,rc_user_text from recentchanges order by rc_id desc LIMIT 0,5;
+--------------+-----------------------------------------------------------------------+--------------+
| rc_title     | rc_comment                                                            | rc_user_text |
+--------------+-----------------------------------------------------------------------+--------------+
| eAccelerator |                                                                       | Mutante      |
| debianize    |                                                                       | Mutante      |
| FOLDOC       |                                                                       | Mutante      |
| FOLDOC       | New page: FOLDOC ==> Free On-line Dictionary of Computing  {{foldoc}} | Mutante      |
| foldoc       |                                                                       | Mutante      |
+--------------+-----------------------------------------------------------------------+--------------+
5 rows in set (0.00 sec)

mysql> select distinct rc_title from recentchanges order by rc_id desc LIMIT 0,5;
+--------------+
| rc_title     |
+--------------+
| eAccelerator |
| debianize    |
| FOLDOC       |
| foldoc       |
| Dotdeb       |
+--------------+
5 rows in set (0.00 sec)

As you can see, in the first query i get 2 results for rc_title FOLDOC and it is not really distinct, whereas in the second query i only get disctinct titles like i want. But how do i get only distinct titles together with their rc_comment and rc_user_text now?