Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    13

    Unanswered: hw to update a column value when it already have a value?

    Hi,

    i need to update the value in the column by adding to the value already in that column.

    For eg, the value is in the column is already 5, i need to update it with addition of 8. i.e 5+8 = 13. The final value should be 13 in the column after that.
    How do I go about doing it?


    UPDATE Table 1 SET ColumnName +=8 ?

    Thanks in advance. really at a loss and very urgent.

  2. #2
    Join Date
    Mar 2004
    Posts
    80

    Re: hw to update a column value when it already have a value?

    UPDATE Table 1 SET ColumnName=ColumnName +8

    Originally posted by sunspot
    Hi,

    i need to update the value in the column by adding to the value already in that column.

    For eg, the value is in the column is already 5, i need to update it with addition of 8. i.e 5+8 = 13. The final value should be 13 in the column after that.
    How do I go about doing it?


    UPDATE Table 1 SET ColumnName +=8 ?

    Thanks in advance. really at a loss and very urgent.

  3. #3
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    You could have gone thru books online also for reference.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

Posting Permissions

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