There is a table of messages
, which has the following form: _id (prim key), author, client, time, content.
Let it have the following meanings:
_id | author | client | time | content -------------------------------------- 1 | user | you | 21:52 | hi 2 | user | you | 20:43 | wassup 3 | user2 | you | 17:45 | привет 4 | user2 | you | 18:20 | :(
From this table you need to get one (last) message from each author, where client = you
.
Those. using the request, you need to return messages with id 1 and 4 ( hi
and :(
). How can this be done?