Quantcast
Channel: Getting started with SQL Server forum
Viewing all articles
Browse latest Browse all 9243

Help with SQL Query

$
0
0
Hi I have a table as below,

UserID       Date                    Usage
1              22/03/2013           97.99
1              22/03/2014           83.99
1              23/03/2013           75.99
1              23/03/2013           81.99
2              25/03/2013           66.99
2              25/03/2013           66.99
2              26/03/2013           55.99

I need to calculate the average usage for a user per day.

Output would
be:
UserID           Date                 Usage
1              22/03/2013            90.99
1              23/03/2013            78.99

I have got the distinct dates but am not able to iterate through the dates.Please
help!

Thanks.

Viewing all articles
Browse latest Browse all 9243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>