February 11th, 2004, 02:08 AM
Help with a query!
I have a little problem...hope anyone can help me with this.
There is 2 tables:
- In the first table there is a column named "name" (of course there is more columns with adress an so on), many rows have the same data.
- In the second table there is one column named "nickname" and one named "id".
- The "name" and "id" columns have the same data.
I want to make a query that takes out the "name" column in the first table and replaces that data with the data from the "nickname" column, so everyone with name "name"="id" should have the nickname instead.
Anyone understand what I'm trying to do?!
February 11th, 2004, 02:24 AM
It is a simple join.
Select b.nickname, a.address, a.otherInfo
From table1 as a
inner Join table2 as b on a.name = b.id
correct me if that's not what you mean.
February 11th, 2004, 04:38 AM
That whas exactly what I ment.
Now I'm going to study a little about joins...