skip to Main Content

PostgreSQL: return json as a list

I have mixed types of values in the columns but all of them are json object: one field stored as text in column_a: {'field0': 'value0'} another field as json (list of) in column_b: [{'field1': 'value1'},{'field2','value2'}] depending on emptiness of the…

VIEW QUESTION

Postgresql. Create output like JSON

I have table like next Name tblname_01 tblname_02 tblname_03 CREATE TABLE test ( name varchar(128) ); INSERT INTO test VALUES ('tblname_01'), ('tblname_02'), ('tblname_03'); SELECT * FROM test; I would like to get next output: { "rule-type": "selection", "rule-id": "1001", "rule-name":…

VIEW QUESTION
Back To Top
Search