January 18, 2012 at 8:55 am
I actually need to update an existing column with incremental numbers..as shown... Can you help me to write a script to get the following output.
COLA COLB
1 Username1
2 Username2
3 Username3
N UsernameN
Thank you...
January 18, 2012 at 8:59 am
DBA_SQL (1/18/2012)
I actually need to update an existing column with incremental numbers..as shown... Can you help me to write a script to get the following output.COLA COLB
1 Username1
2 Username2
3 Username3
N UsernameN
Thank you...
you mean like this?
UPDATE YourTable
SET COLB = 'Username' + CONVERT(varchar,COLA)
Lowell
January 18, 2012 at 9:33 am
Well..I just tried and got the result... Thanks for response..
update tablename
set
columnname = 'Username' + substring(convert(varchar(32), ID), 1, 10)
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply