I am doing a chat and I need to make a query to my database in which I bring the last message that a user received from each person with whom he wrote, the query should be based on the date, the last message according to the date
the table would be the following
id id_destination message sender date
1 1123 hi 1133 18/06/2019
2 1123 bye 1133 17/06/2019
3 1123 ok 1144 18/06/2019
4 1123 hi 1144 17/06/2019
I need that once executed the query will show me in the following way:
id id_destination message sender date
1 1123 hi 1133 18/06/2019
3 1123 ok 1144 18/06/2019