I am trying to write a sql query but i find some difficulties.What i want is:
Lets suppose we have a table where we store the times that a video have been watched, per day.
So for example:
- day: 14/11/2011, video_id: 3539, timeswatched: 125
- and: 15/11/2011, video_id: 3539, timeswatched: 162
(so the table stores video_id,day,timeswatched)
What i want is to make a billboard/chart type which show the percentage change of the timeswatched of the 8 top viewed (for today) videos between the dates: today and yesterday.
(note that a video may have not been watched at all today or yesterday – should this be a problem or not?)
So the result should be something like this: video-id: 3539 has +23% or -44% (or..) more/less views today (we need to know how to find the 23%)
Thanks!
1 Answer