sql - Translate function not returning relevant string in amazon redshift -


i trying use simple translate function replace "-" in 23 digit string. example of 1 such string "1049477-1623095-2412303" expected outcome of query should 104947716230952412303

the list of "1049477-1623095-2412303" present in single column "table1". name of column "data"

my query

select translate(t.data, '-', '') table1 t 

however, returning 104947716230952000000 output.

at first, thought overflow error since resulting integer 20 digit tried use following

select cast(translate(t.data,'-','') varchar) table1 t 

but not working well.

please suggest way have desirable output

this long comment.

this code:

select translate('1049477-1623095-2412303', '-', '') 

is going return:

'104947716230952412303' 

the return value string, not number.

there no way can return '104947716230952000000'. imagine happening if somehow value being converted numeric or bigint type.


Comments

Popular posts from this blog

how to add preprocess loader in webpack 2 -

python - django admin: changing the way a field (w/ relationship to another model) is submitted on a form so that it can be submitted multiple times -

go - serving up pdfs using golang -