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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 add to an existing number

Author  Topic 

sfjtraps
Yak Posting Veteran

65 Posts

Posted - 2009-07-29 : 16:14:53
Can anyone tell me the syntax to SELECT a number from a column, add 10 to it, and then replace it where it originally was?

Please help, I know these are basic questions, pardon my lack of SQL knowledge

thanks,

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-07-29 : 16:18:44
You want an UPDATE.
UPDATE Table1
SET Col1 = 10 + Col1
WHERE SomeOtherCol = {SomeValueHere}



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

sfjtraps
Yak Posting Veteran

65 Posts

Posted - 2009-07-29 : 16:20:51
thank you so much!!
Go to Top of Page
   

- Advertisement -