AAAAGGGGHHH!!! Help!!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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_
WHERE
visitors.created > DATE_SUB( CURRENT_DATE, INTERVAL 1 HOUR )
AND
id = pixeldata_.remote
GROUP BY
visitors.id

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.

Mike







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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux