SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: UPDATE syntax

Hybrid View

  1. #1
    SitePoint Zealot avolia's Avatar
    Join Date
    Jun 2001
    Location
    USA
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    UPDATE syntax

    Hello,

    I have two different tables both have the same userID and number of records.
    In table2 I have a column name comments and table1 I have a column named custom_1.

    the field comments in table2 is empty and I want to transfer data from table1.custom_1 to table2.comments.

    I tried using the UPDATE statement but with no success.

    Is there away to do this?

    Thanks.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,263
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    yes, there is a way, you need to be on 4.0.something
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Zealot avolia's Avatar
    Join Date
    Jun 2001
    Location
    USA
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I figured out another way of doing it. I created a new table with the same structure as table2.
    Then did an insert statment with a select statement joinging table1&table2.

    This gave me the fields I am looking for from both tables

    Thanks.


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
  •