clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2335898 fiddles created (27459 in the last week).

CREATE TABLE t ( a,b ) AS SELECT 1, null FROM DUAL UNION ALL SELECT 2, 'bb' FROM DUAL;
2 rows affected
 hidden batch(es)


select json_object( KEY 'a' VALUE a, KEY 'b' VALUE b null on null ) c1, json_object( KEY 'a' VALUE a, KEY 'b' VALUE b absent on null ) c2 from t;
C1 C2
{"a":1} {"a":1}
{"a":2,"b":"bb"} {"a":2,"b":"bb"}
 hidden batch(es)


select json_object( KEY 'a' VALUE a, KEY 'b' VALUE b absent on null ) c2, json_object( KEY 'a' VALUE a, KEY 'b' VALUE b null on null ) c1 from t;
C2 C1
{"a":1,"b":null} {"a":1,"b":null}
{"a":2,"b":"bb"} {"a":2,"b":"bb"}
 hidden batch(es)