Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL to reduce an entire column of a table?

Author  Topic 

JSkirt
Starting Member

2 Posts

Posted - 2010-01-22 : 09:52:14
Ok i have a table called sql_table_1, and a column called "sss"
each record's sss value ranges from 1 to 200

I want to use an SQL statement to reduce every sss value inthe table sql_table_1 by 10%, saving these new values to the db.

how can i do this?

Thanks

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-01-22 : 10:05:51
What datatype is sss in the table?
To reduce 1 by 10% cannot be an int for example...


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-01-22 : 10:09:12
UPDATE sql_table_1
SET new_sss = 0.90 * sss



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-01-22 : 10:15:36
alter schwede


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

JSkirt
Starting Member

2 Posts

Posted - 2010-01-29 : 09:19:20
many thanks peso, that did the trick!
Go to Top of Page
   

- Advertisement -