Click here to Skip to main content
15,892,517 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Iam facing one problem like

columna
40100473347
910028421331
1010067535071

i want to update this column value like in below format

columna
84010100473347
00910028421331
01010067535071

how to write query for this
Posted
Comments
Suvendu Shekhar Giri 1-Jul-15 3:15am    
Just write an update statement, preferably based on PK.

1 solution

SQL
update mytable set columna = '84010100473347' where columna = '40100473347';

and so on ( "SQL update statement"[^]).
 
Share this answer
 
Comments
Member 11337367 1-Jul-15 3:27am    
like that so many values are there more than thousands values please tell me to update in one shot..
CPallini 1-Jul-15 3:39am    
You cannot do that in one shot, unless there is a pattern there. For instance it looks you are left-padding last two strings with zeroes, but that doesn't apply to first one.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900