Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
remove properties from jsonb using function jsonb_set of PostgreSQL
drop table if exists account; create table account(name text, data jsonb); insert into account values ('1', '{"flags": {"name": "john", "type": "food", "pay": true, "convert": true}, "level": 1}'), ('9', '{"flags": {"name": "b", "type": "drink", "pay": false, "convert": true, "form1": true}, "level": 8}'); update account set data = jsonb_set(data, '{flags}', (data->'flags') - 'convert' - 'form1') where data->'flags'->>'convert' = 'true'; select * from account;
run
|
edit
|
history
|
help
0
raja
by prasanthjohn, 2 years ago
Please
log in
to post a comment.
tic tac toe
Ultima Clase
Sample tables
Islands demonstration
test
Current time/date, timezone
m,,nm,
SQL2_CLASS
FlujoPadre
Ecommerce Website Analysis by SQL
raja
by prasanthjohn, 2 years agoPlease log in to post a comment.