DROP TABLE demo
ORA-00942: table or view does not existMore Details: https://docs.oracle.com/error-help/db/ora-00942
CREATE TABLE demo
( col1 NUMBER,
col2 VARCHAR2(30) )
Table created.
INSERT INTO demo
VALUES(1,'One')
1 row(s) inserted.
INSERT INTO demo
VALUES(2,'Two')
1 row(s) inserted.
INSERT INTO demo
VALUES(3,NULL)
1 row(s) inserted.
COMMIT
Statement processed.
SELECT JSON_OBJECT (
KEY 'col1' IS d.col1 FORMAT JSON, -- FORMAT JSON is optional
KEY 'col2' IS d.col2, -- if data comes from table
KEY 'col3' IS 'TEXT' FORMAT JSON, -- but not otherwise
KEY 'col4' IS d.col1 ABSENT ON NULL -- NULL ON NULL is the default behavior
) col1
FROM demo d
ORDER BY d.col1
| COL1 | {"col1":1,"col2":"One","col3":TEXT,"col4":1} | {"col1":2,"col2":"Two","col3":TEXT,"col4":2} | {"col1":3,"col3":TEXT,"col4":3} |
|---|