A.Amidi
A.Amidi

Reputation: 2522

Time aggregation in SQL

I have a data-set which includes time {hh,mm,ss} and temperature. I want to aggregate the temperature with respect to the time. For each minute in a specific hour there are number of temperature records and I want to calculate the average of them to have a single value for each minute.

Thanks in advance.

Upvotes: 2

Views: 166

Answers (1)

Germann Arlington
Germann Arlington

Reputation: 3353

Use date functions ( http://www.w3schools.com/sql/ ) to get more general (less precise) time [i.e. Hour and Minute only], group by that and use Average SQL function to get your average value.

Upvotes: 1

Related Questions