I have a bunch of data which is expressed in terms of start and stop
dates, e.g.:
And what I want is a graph over time showing the number of members on each day. Thus the input is rows with time ranges, and the output is a scalar for each time bucket. The time bucket might be months, days, hours, or quarter hours. Such a data series could then be loaded into a spreadsheet or otherwise graphed. I've got a perl script that can do this. But is there a good and fast way to do this in the database? If I had views with the scalar data, then I could do some more interesting joining like comparing member growth to advertising dollars spent, or calculating the ratios between members and customer service calls. It seems like a lot of data is inherently stored as time ranges. How would you query and manipulate such data? -- ---- Visit http://www.obviously.com/ |
- [SQL] Technique for turning time ranges into a graph Bryce Nesbitt