I have 2 tables... a person table and a message table.
[person]
person_id | person_name | person_age
1 | ralph | 22
2 | george | 46
3 | bob | 8
[message]
message_id | person_to | person_from | message_text
1 | 2 | 1 | sample text
2 | 3 | 1 | sample text
3 | 3 | 2 | sample text
I want to return an sql result with the names/ages of both the person_to and person_from.
[results]
message_id | person_name_to | person_name_from | person_age_to | person_age_from | message_text
1 | george | ralph | 46 | 22 | sample text
2 | bob | ralph | 8 | 22 | sample text
3 | bob | george| 8 | 46 | sample text
can this be done with sql?