I am running a query in mysql :

SELECT DISTINCT (id) AS visitor_id,
MAX(date_time) AS last,
MIN(date_time) AS first,
UNIX_TIMESTAMP( MAX(date_time)) -
UNIX_TIMESTAMP( MIN(date_time)) AS diff
FROM visitors, pixeldata_
visitors.created > DATE_SUB( CURRENT_DATE, INTERVAL 1 HOUR )
id = pixeldata_.remote

The idea behind the WHERE clause is to only get results from the last hour.
I have used this construct successfully in dozens of other queries.
However, the results here are giving me every single visitor in the table.
Regardless of when created.

In other words that part of the WHERE clause is not working.  Does anybody
see any problem in the sql that I'm not seeing??  This is driving me nuts.


PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to