I have a TEXT
column containing valid JSON string.
CREATE TABLE users(settings TEXT);
INSERT INTO users VALUES ('{"language":"en","gender":"male"}');
INSERT INTO users VALUES ('{"language":"fr","gender":"female"}');
INSERT INTO users VALUES ('{"language":"es","gender":"female"}');
INSERT INTO users VALUES ('{"language":"en","gender":"male"}');
I want to transform some fields into a query-able format.
A REGEXP_REPLACE
for each field would do (language
field and gender
field). But since it's valid JSON, is there way to:
SQLFiddle: http://sqlfiddle.com/#!12/54823