I need to get last conversation records by to_user in Descending order.
I have table called messages. Please have a look on the following screen shot:
I want the output in the following manner:
from_user| to_user | message |
241 | 226 | How are you? |
241 | 256 | Hi test message |
I have tried this query:
SELECT * FROM `messages` where from_user=241 group by to_user order by created DESC
I am getting the following output which is wrong:
Thanks in advance.