Hi, I'm having troubles trying to aggregate some data. The source table is like this:
Staff Shop Colour Value
----- ---- ------ -----
1 1 R 50
2 1 R 35
3 1 R 44
1 2 R 70
2 2 R 34
1 1 B 90
2 1 B 34
1 2 B 56
3 2 B 23
1 3 B 45
2 3 B 23
3 3 B 34
And I'd like to create an output (can be just in Query Analyzer) of the average "Value" of each "Colour" aggregated by "Shop" like this:
Shop Avg_R Avg_B
---- ----- -----
1 43 62
2 52 39.5
3 [NULL] 34
Thanks a mil!
NHW
Staff Shop Colour Value
----- ---- ------ -----
1 1 R 50
2 1 R 35
3 1 R 44
1 2 R 70
2 2 R 34
1 1 B 90
2 1 B 34
1 2 B 56
3 2 B 23
1 3 B 45
2 3 B 23
3 3 B 34
And I'd like to create an output (can be just in Query Analyzer) of the average "Value" of each "Colour" aggregated by "Shop" like this:
Shop Avg_R Avg_B
---- ----- -----
1 43 62
2 52 39.5
3 [NULL] 34
Thanks a mil!
NHW