I'm trying to use the "union" between 2 sql statements, not sure how the group by feature should be placed, for example:
I'd like to put A next to B in a report.......
Select "field1", "field2", SUM("field3") AS "A"
From "table"
Where "field2"=1
UNION
Select "field1", "field2", SUM("field3") AS "B"
From "table"
Where "field2"=2
GROUP BY??????( I keep getting a response suggesting something in my "Select" statement isn't in my "Group BY" or visa versa
I'm using the same table and fields.
I'd like to put A next to B in a report.......
Select "field1", "field2", SUM("field3") AS "A"
From "table"
Where "field2"=1
UNION
Select "field1", "field2", SUM("field3") AS "B"
From "table"
Where "field2"=2
GROUP BY??????( I keep getting a response suggesting something in my "Select" statement isn't in my "Group BY" or visa versa
I'm using the same table and fields.