Results 1 to 3 of 3

Thread: Help with Column!

  1. #1
    Join Date
    Feb 2008
    Posts
    1

    Help with Column!

    Hello Database Experts,

    I need your help guys as I need to add a constant number to a column with existing numbers already like:

    TABLE COLUMN_X
    1 .......... 12
    2 .......... 14
    3 .......... 8


    Now, i just need to say add 10 to all values in COLUMN_X so the final table will become:

    TABLE COLUMN_X
    1 .......... 22
    2 .......... 24
    3 .......... 18


    Please help as I am very new to MS SQL.

    Thanking you all in advance.


    Powerhouse
    MSSQL 2000 enterprise ed
    Last edited by powerhouse; 02-08-2008 at 02:30 AM.

  2. #2
    Join Date
    Dec 2004
    Posts
    502
    UPDATE Table
    SET Column_X = Column_X + 10
    WHERE ...

  3. #3
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    --This will update all the rows in the table

    UPDATE Table
    SET Column_X = Column_X + 10

Posting Permissions

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