I have a table that I use for statistical purposes.
Its columns are id
and 1
,2
,3
,..,31
and pivot
.
This table gives the number of views on each day for the last 31 days.
1
gives the number of views for yesterday.
14
gives the number of views for 14 days ago.
etc ...
(pivot
is just used to calculate the number of views)
I would use a cron job every day to update this table, but how would I go about "shifting" all the values to the side ( value column 15
would become value column 16
; new value for column 1
; delete value for column 31
)