I have two tables.
"Person" Table with three fields
PK: person_id,
first_name,
last_name.
"Message" table
PK: message_id,
FK: receiver_id,
FK: sender_id,
message_body
The receiver_id and sender_id in the message table refer to
the person_id in the person table.
I want to write a query, using where clause (only), with the following format:
Expand|Select|Wrap|Line Numbers
- SELECT
- first_name AS "Sender's First Name",
- last_name AS "Sender's Last Name"
- first_name AS "Receiver's First Name",
- last_name AS "Receiver's Last Name"
- FROM
- message, person
- WHERE
- message.sender_id = 1
- AND message.sender_id = person.person_id
- ???????;
Your assistance is appreciated.