MySQL Forums
Forum List  »  Newbie

same names
Posted by: jason farrell
Date: April 07, 2005 01:53PM

I have 2 tables. One has a list of names and the other has a message, the person it's from and the person it's to. the sql draws off the person to and from out of the list of names.

it's basically structured as:

name table:

name | id
-----------------
jackson | 1
johnson | 2


message table:

message | personto | personfrom
-------------------------------------------
bla | 1 | 2
blabla | 2 | 1

my sql so far is:
"SELECT * FROM messagetable RIGHT JOIN nametable ON messagetable.personfrom = nametable.id"


how do i join the person to in the code, because they both use the same row name, of "names"

thanks,
jason

Options: ReplyQuote


Subject
Written By
Posted
same names
April 07, 2005 01:53PM
April 07, 2005 02:00PM
April 07, 2005 03:55PM
April 07, 2005 04:03PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.