sql - Aggregating 15-minute data into weekly values -
i'm working on project in want aggregate data (resolution = 15 minutes) weekly values.
i have 4 weeks , view should include value each week , every station. dataset includes more 50 station.
what have this:
select name, avg(parameter1), avg(parameter2) data week in ('29','30','31','32') group name order name
but displays avg value of weeks. need avg values each week , each station.
thanks help!
the problem when 'group by' on name flatten weeks , can perform aggregate functions on them.
your best option group on both name , week like:
select name, week, avg(parameter1), avg(parameter2) data week in ('29','30','31','32') group name, week order name
ps - it' not entirely clear whether you're suggesting need 1 set of results stations , 1 weeks, or whether need set of results every week @ every station (which answer provides solution for). if require former separate queries way go.
Comments
Post a Comment