X
Xmas
Hi
I am trying to do something simple but failing. I am trying to get
aggregate data with different conditions in a SQL query.
That is, with a table date,fooA,fooB, I want to output rows containing
year, average fooA (where fooB=1) average fooA (where fooB=2) average
fooA (where fooB=3) group by year(date)
The tests I need on fooB are rather more complex but this is essentially
what I am after, but can't break it down into a single query. UNION
merges rows from different queries and I want to merge columns!
I am trying to do something simple but failing. I am trying to get
aggregate data with different conditions in a SQL query.
That is, with a table date,fooA,fooB, I want to output rows containing
year, average fooA (where fooB=1) average fooA (where fooB=2) average
fooA (where fooB=3) group by year(date)
The tests I need on fooB are rather more complex but this is essentially
what I am after, but can't break it down into a single query. UNION
merges rows from different queries and I want to merge columns!