Example: Using JSON_AGG without GROUP BY and No Parameter Names

Teradata Vantageā„¢ JSON Data Type

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1150-162K
The example selects columns from a table and uses JSON_AGG to compose those columns into JSON objects.
SELECT JSON_agg(empID, company, empName, empAge)
FROM emp_table;

Result:

JSON_agg
--------
[{ "empID" : 1, "company" : "Teradata", "empName" : "Cameron", "empAge" : 24 },{ "empID" : 2, "company" : "Teradata", "empName" : "Justin", "empAge" : 34 },{ "empID" : 3, "company" : "Teradata", "empName" : "Someone", "empAge" : 24 }]