Advanced Join help
Posted: Thu Aug 08, 2002 12:01 pm
Greetings.
Lets say I have a table called 'users'.
Users has fields: favcolor, favanimal and favcar
Lets also say, I have 3 additional tables: colors, animals and cars.
favcolor, favanimal and favcar fields contain only the unique ID's of the color/animal/car in their respective tables.
Lets say I want to dump the contents of the users table:
John, 2, 6, 8 could be one of the rows. However, I want the actual text displayed, not the unique ID which it corresponds to.
John, red, eagle, ford mustang
I could use a JOIN for one of the fields, but is there a way I can join multiple tables to 'users' so that I can lookup the rest of the info?
If I were using pgSQL I suppose I could use subselects, but I don't have that luxery as I'm using MySQL.
Your help is greatly apprecaited.
--cheers
Lets say I have a table called 'users'.
Users has fields: favcolor, favanimal and favcar
Lets also say, I have 3 additional tables: colors, animals and cars.
favcolor, favanimal and favcar fields contain only the unique ID's of the color/animal/car in their respective tables.
Lets say I want to dump the contents of the users table:
John, 2, 6, 8 could be one of the rows. However, I want the actual text displayed, not the unique ID which it corresponds to.
John, red, eagle, ford mustang
I could use a JOIN for one of the fields, but is there a way I can join multiple tables to 'users' so that I can lookup the rest of the info?
If I were using pgSQL I suppose I could use subselects, but I don't have that luxery as I'm using MySQL.
Your help is greatly apprecaited.
--cheers