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
 add columns

Author  Topic 

constantinos1987
Starting Member

25 Posts

Posted - 2008-12-01 : 13:03:25
data:
0000000068908,92,01,False
0000000110838,92,01,False
0000000113484,92,03,False
0000000113487,92,01,False
0000000113502,92,01,False
0000000174387,92,03,False

i want to add the data of column 3 to the existed data of column 2
the result i want to archive is:

0000000068908,01-92,01,False
0000000110838,01-92,01,False
0000000113484,03-92,03,False
0000000113487,01-92,01,False
0000000113502,01-92,01,False
0000000174387,03-92,03,False

does anyone knows how???

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-01 : 13:08:25
[code]UPDATE Table
SET Col2=CAST(Col3 AS varchar(2)) + '-' + Col2[/code]
Go to Top of Page

constantinos1987
Starting Member

25 Posts

Posted - 2008-12-01 : 13:47:27
thank you very much!!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-02 : 00:41:53
you're welcome
Go to Top of Page
   

- Advertisement -