Skip to content

Tag: replace

How to convert decimal values to time values in oracle?

I have a table that is formatted like this: I want the output to be like this: Basically transform the values in the dec_time field into time values like the example above in new_dec_time. This is my SQL so far: This simply changes replaces the decimal point with the semicolon but doesnt add the 0s where need…

Remove trailing comma

I have a table with names formatted as “Smith, Stan” and need to display them as “Stan Smith”. I was able to do that but it seems that the comma has been left behind and I need to get rid of it. This is what I currently have: Answer How about using replace as below

presto replace multiple characters

I have a string and would like to remove a set of characters. Is there a better way than chaining multiple replace()? I came up with the following but it requires a replace() call for each character: This is a minimal example and I have more characters to escape so I was looking for a less verbose way of achi…