Hi,
I have two tables, namely "people" and "messages". I need to do a join between the two tables so that I can see who sent the message, who recived the message and the message details and ordered by the message receiver. Sample tables below:
So effectively I need it to read:
Joe Bloggs | Jane Bloggs | Hi how r u? |
What would be the correct syntax?
Reality is built on a foundation of dreams.
I have two tables, namely "people" and "messages". I need to do a join between the two tables so that I can see who sent the message, who recived the message and the message details and ordered by the message receiver. Sample tables below:
Code:
+-----------------------------------------+
|| people ||
+-----------+--------------+--------------+
| person_id | person_fname | person_lname |
+-----------+--------------+--------------+
| 1 | Joe | Bloggs |
| 2 | Jane | Doe |
-------------------------------------------
+-----------------------------------------------------+
| messages |
+-----------------------------------------------------+
| mess_id | mess_sender | mess_receiver| mess_message |
+---------+-------------+--------------+--------------+
| 1 | 1 | 2 | Hi how r u? |
-------------------------------------------------------
Joe Bloggs | Jane Bloggs | Hi how r u? |
What would be the correct syntax?
Reality is built on a foundation of dreams.