Skip to content
Advertisement

Tag: type-conversion

Convert character to number, like +00005 to 5

We have the fixed format data and it has the number with plus/minus sign, like +00005 or -00005. We’d like to convert it to number but Redshift seems not to allow implicit conversion. So, I temporarily use to_number(replace(<numbercolumn>, ‘+’, ”),’99999′) But I guess there should be more better solutions. Anyone know more smart way, your advice would be highly appreciated.

Problem reading uniqueidentifier from SQL response

I have tried to find the solution for this problem, but keep running my head at the wall with this one. This function is part of a Go SQL wrapper, and the function getJSON is called to extract the informations from the sql response. The problem is, that the id parameter becomes jibberish and does not match the desired response,

Pass subquery value to IN statement

In one table named prefs, I have a column named “Value” of type clob that holds this value: ‘T’, ‘L’ I need to query table attendance_code to retrieve the records where column att_code values are either T or L. The att_code column is of type varchar2. As a manual model query, this works fine: Attempt 1 Attempt 2 This yields

Advertisement