I think: change "id" to visitor_id
If it still doesn't work, make sure date_sub and created are of the same
type -- created must be in "-mm-dd hh:mm:ss" format (datetime type) in
order for that to work; the > might even fail (can't remember).
why not do
... where unix_timestamp(visitors.crea
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 = pixel