I'd like to receive the output of a few sub queries(each of them return a single column with different number of rows) into a single response.
I'm trying the following but it doesn't work with error as [21000] ERROR: more than one row returned by a subquery used as an expression.
SELECT
(SELECT DISTINCT org_name
FROM table_1
WHERE column1= 1) AS terminal_1,
(SELECT org_name
FROM table_5
WHERE column5= 1) AS cfs_1,
(SELECT DISTINCT org_name
FROM table_4 where column7= 136 ) AS terminals_2,
(SELECT org_name
FROM table_6
WHERE column1=7) AS cfs_2;
I'd like to do in the way such that in future I can add a few more sub-queries, each of which will also return a single column with a different number of rows. Is there a good practice to achieve the same? Thank you.
EDIT 1: The output response could be in any logical form. i.e. tabular or JSON.