#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Location
    Swe
    Posts
    2
    Rep Power
    0

    Unhappy Help with a query!


    Hi!
    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?!
    /Nicke:
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Location
    Los Angeles, CA
    Posts
    21
    Rep Power
    0
    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.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Location
    Swe
    Posts
    2
    Rep Power
    0
    Thank you.
    That whas exactly what I ment.
    Now I'm going to study a little about joins...
    /Nicke

IMN logo majestic logo threadwatch logo seochat tools logo