Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
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 AI support!

Copy Clear