SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru GamerZ's Avatar
    Join Date
    Nov 2001
    Location
    Singapore
    Posts
    617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Upate A Field With Its Current Data Plus New Data?

    How can i retain a field data and plus new data to tt field.

    For example, a field name 'test' has a string value of "Testing". How do I run an Update statement that update 'test' whereby the current string value 'Testing' still remains and I want to add in a new string?


    Thanks.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,016
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    Code:
    update yourtable
     set test = concat(test,'new string')
    where test = 'Testing'
    note the WHERE clause prevents updating every row in the table
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Guru GamerZ's Avatar
    Join Date
    Nov 2001
    Location
    Singapore
    Posts
    617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937
    Code:
    update yourtable
     set test = concat(test,'new string')
    where test = 'Testing'
    note the WHERE clause prevents updating every row in the table
    Thanks Alot. It Works =D


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
  •