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

rest - Spring boot: Request method 'PUT' not supported -

php - Magento - Deleted Base url key -

symfony - imagine_filter() not generating the correct url in LiipImagineBundle -