SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Mar 2005
    Location
    Concord, North Carolina
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Is there a querie/command to...

    I'm relatively inexperienced in actually using queries or scripts in a database, but something I'm working on would really be helped if a query could do something. I'm going to explain this as best as I can, and hopefully at least it's understandable.

    What I want to do is take a certain field in a table and have all the values be replaced by corresponding values in a field in completely different table (if it takes moving this field, so be it, that's not the issue).

    The value it would being changed from is an integer, and the value it would be changed to would be varchar. The way they correspond is another field in the table containing the varchar value that contains the integer value from the field whose values I want to change.

    Hopefully, that at least made sense.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by DVS Pepsi Man
    The way they correspond is another field in the table containing the varchar value that contains the integer value from the field whose values I want to change.
    even after three or four readings, that sentence just doesn't mean anything to me

    can you show some sample rows from your tables?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Member
    Join Date
    Mar 2005
    Location
    Concord, North Carolina
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, believe it or not, I didn't even have to use mySQL to do what I needed.

    I also figured out that there is a way to do what I wanted to do (which I don't feel like rephrasing at the moment - I'm sorry for that, just a draining time for me right now) using an update query.

    It's whacked the way this is all going. After thinking things through, without even reading any instructions, I keep ending up being able to do what I want to do in the end.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •