I have a table with the following fields:
Date City Category Value
01-Jan-07 London A 100
02-Jan-07 London A 150
03-Jan-07 London B 120
04-Jan-07 London A 100
05-Jan-07 London B 110
06-Jan-07 London B 105
07-Jan-07 London A 100
01-Jan-07 Tokyo B 100
02-Jan-07 Tokyo C 150
03-Jan-07 Tokyo B 120
04-Jan-07 Tokyo B 100
05-Jan-07 Tokyo B 110
06-Jan-07 Tokyo C 105
07-Jan-07 Tokyo C 100
I wish to aggregate this information by City and Category, to produce the following result:
City Categories Totals
London AB 805
Tokyo BC 785
Is there a simple way that I can concatenate the Categories associated with each city, to produce the desired "Categories" field aggregation.
I know how to Crosstab to get the categories into separate columns for each City and Category, but dont know how to collapse the records further from here (from within the SQL Statement).
Any help would be appreciated,
Thanks,
Steve Lewy
Solutions Developer
SimplyData
simplydata.com.au
(dont cut corners or you'll go round in circles)
Date City Category Value
01-Jan-07 London A 100
02-Jan-07 London A 150
03-Jan-07 London B 120
04-Jan-07 London A 100
05-Jan-07 London B 110
06-Jan-07 London B 105
07-Jan-07 London A 100
01-Jan-07 Tokyo B 100
02-Jan-07 Tokyo C 150
03-Jan-07 Tokyo B 120
04-Jan-07 Tokyo B 100
05-Jan-07 Tokyo B 110
06-Jan-07 Tokyo C 105
07-Jan-07 Tokyo C 100
I wish to aggregate this information by City and Category, to produce the following result:
City Categories Totals
London AB 805
Tokyo BC 785
Is there a simple way that I can concatenate the Categories associated with each city, to produce the desired "Categories" field aggregation.
I know how to Crosstab to get the categories into separate columns for each City and Category, but dont know how to collapse the records further from here (from within the SQL Statement).
Any help would be appreciated,
Thanks,
Steve Lewy
Solutions Developer
SimplyData
simplydata.com.au
(dont cut corners or you'll go round in circles)