I stedet for at opdatere tæller pr. dag, uge osv. INDSÆT bare en række i en tabel hver gang en aktivitet sker som denne:
insert into activities (activity_date, activity_info)
values (CURRENT_TIMESTAMP, 'whatever');
Nu er dine rapporter meget enkle som:
select count(*) from activities
where activity_date between '2008-01-01' and '2008-01-07';
eller
select YEARWEEK(`activity_date`) as theweek, count(*)
group by theweek