I'll try to create a query where the result can be from two different tables depending on the size of the first table. Is something comparable even possible?
SELECT
CASE WHEN COUNT(table1.column1) > 5
THEN
column1,
column2,
column3
FROM table1
ELSE
column1,
column2,
column3
FROM table2
END
With this code I got something like this:
ERROR: syntax error at or near ","
LINE 4: column1,
SELECT CASE WHEN COUNT(var1) > 5 THEN (column1, column2, column3 FROM table1) ELSE ( column1, column2, column3 FROM table2) END. I have not tried, it is a wild guess.ERROR: syntax error at or near "FROM" LINE 4: FROM table1)var1? Is it a table column? If yes, from which table?select.