I have the following table A:
id ---- 1 2 12 123 1234
I need to left-pad the id values with zero\'s:
id
id ---- 0
More efficient way is :
Select id, LEN(id) From TableA Order by 2,1 The result : id ---- 1 2 12 123 1234