Hi All,
I know I have not posted before but I do find this site very good for SQL information, however, I am struggling with generating my required output from a table. Let me explain.
I have a table defined as (this is simplified) and with data in as below
Interval_timestamp bp-id countX
Date1+time1 0 5
Date1+time2 0 10
Date1+time1 1 2
Date1+time2 1 4
Date2+time1 0 20
Date2+time2 0 30
Date2+time1 1 10
Date2+time2 1 20
I would like to produce a report like (grouped on date and bp_id in date) with sum of the countX colume, but across the page rather than down :
Date bp_id sum(countX) bp_id sum(countX)
Date1 0 15 1 6
date2 0 50 1 30
i.e I want to have bp_id unique across the top followed by its sum of countX (this could be average or whatever on the total etc). I do not want the list in a sequential order (I can get that), but I want it in parallel.
There are many bp_id's but I have kept it simple with just two unique types. I need something dynamic which would collect all the bp_id's and then do as required.
Now not being an SQL whizz .. I wonder if you guys could help me?
many thanks
Leslie Pendlebury-Bowe
elbowe@yahoo.com
I know I have not posted before but I do find this site very good for SQL information, however, I am struggling with generating my required output from a table. Let me explain.
I have a table defined as (this is simplified) and with data in as below
Interval_timestamp bp-id countX
Date1+time1 0 5
Date1+time2 0 10
Date1+time1 1 2
Date1+time2 1 4
Date2+time1 0 20
Date2+time2 0 30
Date2+time1 1 10
Date2+time2 1 20
I would like to produce a report like (grouped on date and bp_id in date) with sum of the countX colume, but across the page rather than down :
Date bp_id sum(countX) bp_id sum(countX)
Date1 0 15 1 6
date2 0 50 1 30
i.e I want to have bp_id unique across the top followed by its sum of countX (this could be average or whatever on the total etc). I do not want the list in a sequential order (I can get that), but I want it in parallel.
There are many bp_id's but I have kept it simple with just two unique types. I need something dynamic which would collect all the bp_id's and then do as required.
Now not being an SQL whizz .. I wonder if you guys could help me?
many thanks
Leslie Pendlebury-Bowe
elbowe@yahoo.com