Home > Blockchain >  SQL remove curly bracket
SQL remove curly bracket

Time:12-18

When i select a column i get the below results

{"ac92b9f2-c7c7-4d2a-982b-c06bb218a5ed"}

Is there a way to remove the {""} from the results?

CodePudding user response:

This should work on most rdbms (though you should specify your rdbms anyway):

select substr(your_column, 3, length(your_column) - 4)
from your_table

CodePudding user response:

Try this

  Select
     replace(replace(replace(col_name, '{', ''), '}', ''), 
         '"',") from table;

Or as per your data you can simply use

      Select
      Substr(col_name, 3,LENGTH(col_name)-4)
      from table;

Check this for reference demo: http://sqlfiddle.com/#!4/e24574/3

  •  Tags:  
  • sql
  • Related