oracle sql return json

Solutions on MaxInterview for oracle sql return json by the best coders in the world

showing results for - "oracle sql return json"
Leni
24 May 2020
1CopySELECT json_object('id'          VALUE employee_id,
2                   'name'        VALUE first_name || ' ' || last_name,
3                   'hireDate'    VALUE hire_date,
4                   'pay'         VALUE salary,
5                   'contactInfo' VALUE json_object('mail'  VALUE email,
6                                                   'phone' VALUE phone_number)
7                                       FORMAT JSON) 
8  FROM employees
9  WHERE salary > 15000;
10
11-- The query returns rows such as this (pretty-printed here for clarity):
12
13{"id":101,
14 "name":"Neena Kochhar",
15 "hireDate":"21-SEP-05",
16 "pay":17000,
17 "contactInfo":{"mail":"NKOCHHAR",
18                "phone":"515.123.4568"}}