There is table – Item below, how can I get the average Value
according to its 15 minute value from last record time? I am using SQL Server 2008.
Table — Item
Table 15min_AVG
sql serversql-server-2008
There is table – Item below, how can I get the average Value
according to its 15 minute value from last record time? I am using SQL Server 2008.
Table — Item
Table 15min_AVG
Best Answer
Assuming your table and sample data look like this:
One way to write the query is:
SQLFiddle Demo