oracle sql return json
CopySELECT json_object('id' VALUE employee_id,
'name' VALUE first_name || ' ' || last_name,
'hireDate' VALUE hire_date,
'pay' VALUE salary,
'contactInfo' VALUE json_object('mail' VALUE email,
'phone' VALUE phone_number)
FORMAT JSON)
FROM employees
WHERE salary > 15000;
-- The query returns rows such as this (pretty-printed here for clarity):
{"id":101,
"name":"Neena Kochhar",
"hireDate":"21-SEP-05",
"pay":17000,
"contactInfo":{"mail":"NKOCHHAR",
"phone":"515.123.4568"}}