this is my table
id | sender | receiver | msg
-----------------------------
1 | jon | jack | buzz ...
2 | jack | jon | ?
3 | adel | jon | met me soon
4 | jon | adel | okay
5 | alex | jon | where ar u ?
6 | jon | adel | okay
7 | adel | alex | don't forget the party
8 | jon | jack | may i borrow ur car
9 | alex | adel | of course
10 | jack | jon | ok
11 | jack | jon | watch the gas
12 | alex | jon | i'm dying here
13 | jon | alex | 5 mnt ..
and i want get list last messages of jon with his friend like this
id | sender | receiver | msg
-------------------------------------------
13 | jon | alex | 5 mnt ..
11 | jack | jon | watch the gas
6 | jon | adel | okay
How to query, to get that result ?
Use this:
Edit: Thanks for the edit ypercube, I really forgot something important here 🙂