0

Let's say that I have a type STRING column 'debugdata'. An example value for a given user looks like this:

{"TITLE_DESCRIPTION":"approve","CATEGORY":"approve"}

However, let's say there can be multiple values for the TITLE_DESCRIPTION

{"TITLE_DESCRIPTION":"No, name does not match,No, summary is not clear","CATEGORY":"Yes"}

How can I split out the "No, name does not match" and "No, summary is not clear" into two columns?

I've tried using JSON_EXTRACT and JSON_ARRAY_GET and other JSON syntax, but I can't quite break this up into two columns. Thanks!

David דודו Markovitz
  • 42,900
  • 6
  • 64
  • 88
user3521423
  • 11
  • 1
  • 3

2 Answers2

0

lets say x is your map from your example

let x = {"TITLE_DESCRIPTION":"No, name does not match,No, summary is not clear","CATEGORY":"Yes"}

so all you need to do is this:

let b = (x.TITLE_DESCRIPTION).split(',')

edit: in you example you split the sentences with ',' but have ',' in the string himself so use char escape for ',' or use other char for split the sentences and send it to the split function instead of ','.

itay
  • 357
  • 4
  • 16
0

What about first use json_extract and then use the String function split?

FreePeter
  • 752
  • 6
  • 6