I have a small query and a join to add another small query to it. However, there is a syntax error in the union.
Select <column1> ,<column2> From <Table1> <Some joins in there> Where <conditions> group by <column2> order by <column2> union select <column2> ,<column3> ,<column4> From <Table2> <Some more joins here> Where <conditions> group by <column2> order by <column2>
This is the error I get
ERROR: Syntax error at or near 'union'
sql sql-order-by postgresql union
Padagomez
source share