|
Posted by lallous on 02/27/06 01:59
Thanks for your answers.
I am not good with advanced SQL queries. Can you suggest a good link or
tutorial to get me the essentials stuff regarding the inner joins and
outer joins, etc...?
Regards,
Elias"lallous" <lallous@lgwm.org> wrote in message
news:46eo94Fap8opU1@individual.net...
> Hello
>
> I have a MySQL query question please.
>
> I have two tables:
>
> NAMES(id, name)
> TABLE2(rowid, nameid1, nameid2, nameid3)
>
> Example data (NAMES table)
> -------------------------------
> 1 user1
> 2 user2
> 3 user3
>
> Example data (TABLE2 table)
> ------------------------------
> 1 1 1 2
> 2 1 2 3
> 3 3 2 1
>
> How can I write a query, passing it a 'rowid=1' and it should return
> something like:
> rowid=>1, name1=>'user1', name2=>'user1', name3=>'user2'
>
> So, when I pass that query a given ROWID it would return (not the ids of
> the users, but) the names of the users from the NAMES table.
>
> Please advise if it is possible to write that one query, preferrable if it
> is mysql 3.23 compatible.
>
> --
> Elias
[Back to original message]
|