Reputation: 9
I have a column that has a string in a format such as {"en_US":"Hadayek Helwan","ar_EG":"حدائق حلوان"}
I would like to extract both the English phrase "Hadayek Helwan" in one column and Arabic phrase "حدائق حلوان" in another column.
Upvotes: 0
Views: 64
Reputation: 8703
If your data is really stored as this more or less json string, you can parse it like so:
select
new json(<your column>).<json entity>
from
...
So to get the english one, you would use
new json(<your column>).en_US
The entity name is case sensitive. This will only work if the entity exists once in the string.
Upvotes: 1