Posted By

pflangan on 02/09/11



Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


migrate from detailed stats to hourly stats

 / Published in: MySQL

  1. INSERT INTO sitestats_rollup(hitdatetime,hitid,hitcount) SELECT DATE_FORMAT(hitDate, "%Y-%m-%d %h:00:00"), hitKey, count(*) FROM sitestats GROUP BY 1,2 on duplicate key UPDATE hitcount=hitcount+1;

Report this snippet  

You need to login to post a comment.