I need to write a query to retrieve values from two columns using mysql table
My table has the following strucutre
| ID | to_user_id | from_user_id | message | datetime |
| 1 | 21 | 07 | hi | 2012-05-10 04:13:01 |
| 2 | 07 | 21 | hello | 2012-05-10 04:17:51 |
I want to write a query to get both messages user send and get in single query
What about something like this:
It’ll get the rows where user with id 21 is sender and receiver.