Reputation: 143
I have a Table like below sample set.
ColA
AAAA
BBBB
CCCC
I used following query to get the output.
SELECT LPAD (ColA,5,'0')FROM TableName;
I get following output.
ColA
0AAAA
0BBBB
0CCCC
But I want to replace the value in table with the output values. Is it Possible? If yes, some help would be appreciated!
Upvotes: 0
Views: 356
Reputation: 38335
You can insert overwrite table from itself:
insert overwrite table TableName
SELECT LPAD (ColA,5,'0') as ColA,
ColB,
...
ColN
FROM TableName;
Upvotes: 1