teradata - SQL Adding the same char into multiple fields -


i have sql query brings 17 numbers format

06037-11

i need add 0 before dash, is:

060370-11

is there easy way this? have seen stuff() option, don't understand it.

edit using teradata

previous response includes example teradata 14.x using regular expression support. following work in teradata 13.x or teradata 12.x without regular expression support:

select substring('06037-11' 1 (position('-' in '06037-11') -1))     || '0-'     || substring('06037-11' (position('-' in '06037-11') + 1)) 

Comments

Popular posts from this blog

c++11 - Intel compiler and "cannot have an in-class initializer" when using constexpr -

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

c# - Sort XmlNodeList with a specific Node value -