I would like to select only unique row from the table, can someone help me out?
SELECT * FROM table
where to_user = ?
and deleted != ?
and del2 != ?
and is_read = '0'
order by id desc
+----+-----+------+
| id | message_id |
+----+-----+------+
| 1 | 23 |
| 2 | 23 |
| 3 | 23 |
| 4 | 24 |
| 5 | 25 |
+----+-----+------+
I need something like
+----+-----+------+
| id | message_id |
+----+-----+------+
| 3 | 23 |
| 4 | 24 |
| 5 | 25 |
+----+-----+------+
idfor a particularmessage_id?message_idis similar I just want only the last one.