SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table my_table (jsonfield json); insert into my_table values('{ "a": [ {"b": 1}, {"b": 2}, {"b": 3} ] }'); select (json_array_elements(t.jsonfield -> 'a') ->> 'b')::int as b_value, pg_typeof((json_array_elements(t.jsonfield -> 'a') ->> 'b')::int) from my_table t;

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear