SQLize Online / PHPize Online

A A A
Share   Donate   Blog   Popular
Copy Format Clear
create table machines ( id int, payload json ); insert into machines values ( 1, '{ "rack": { "0": { "internal": "20.42706840974966" } }, "personel": { "id": "0xb7c9bd9bc1f7d852", "access_level": "5", "access_level_max": "5" }, "information": { "ID": "machine_1" } }' ); create table personel ( id int, hex varchar(24), name varchar(64) ); insert into personel values (1, '0xb7c9bd9bc1f7d852', 'Tonny Stark'); select p.name, JSON_UNQUOTE(payload->"$.personel.access_level") AS 'Access level', JSON_UNQUOTE(payload->"$.personel.access_level_max") AS 'Max Access level' from machines left join personel p on p.hex = JSON_UNQUOTE(payload->"$.personel.id");
Stuck with a problem? Need help? Ask professionals on our Telegram channel!
Join the channel
Your quersion is posted.
Join our Telegram channel and get answers.
Send
Copy