Find users who have not uploaded certain contents in last 30 days I need to find users who have not uploaded certain contents in last 30 days. I have tried this query it is not working. Can anyone help me?


  select uid, max(created) as max_created from node where 
  node.type in ('page','story') AND
  max_created &lt; UNIX_TIMESTAMP()-2592000


I am getting error in phpmyadmin:


  1054 - Unknown column 'max_created' in 'where clause'
SQL is evaluated backwards, from right to left. So the WHERE clause is parsed and evaluate prior to the SELECT clause. Because of this the aliasing of MAX(created) to max_created not yet occurred.

You can try this,


  SELECT uid, MAX(created) FROM node WHERE node.type IN ('page','story')
  HAVING MAX(created) &lt; UNIX_TIMESTAMP()-2592000