We Recommend

SQL Cookbook SQL Cookbook
Written in O'Reilly's popular Problem/Solution/Discussion style, the SQL Cookbook is sure to please. Anthony's credo is: "When it comes down to it, we all go to work, we all have bills to pay, and we all want to go home at a reasonable time and enjoy what's still available of our days." The SQL Cookbook moves quickly from problem to solution, saving you time each step of the way.


Posted By

berkes on 01/04/07


Tagged

drupal statistics nodes 47


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

basicmagic


Count amout of nodeviews in a year


Published in: SQL 


Counts the total amout of nodeviews between now and a year ago (the last 31536000 seconds).

  1. SELECT SUM(count.totalcount) FROM node_counter count LEFT JOIN node n ON n.nid = count.nid WHERE n.created > (UNIX_TIMESTAMP(NOW())-31536000);

Report this snippet 

You need to login to post a comment.