List:General Discussion« Previous MessageNext Message »
From:Lee Denny Date:July 29 2005 3:42pm
Subject:MAX select problem
View as plain text  
Hello,

I'm trying to get the date and amount of the most visits to my site over a
given time period using :

SELECT max(visits) as maximum FROM visit WHERE (((visit_date >=
'$sdatestring') and (visit_date < '$edatestring')) and (site_id=$site_id))

This gives me the right figure, but when I try to pull out the date that
this occured on with,

SELECT max(visits) as maximum, visit_date FROM visit WHERE (((visit_date >=
'$sdatestring') and (visit_date < '$edatestring')) and (site_id=$site_id))
GROUP BY visit_date

I get a completely different and wrong answer,

any ideas?

Cheers,

Lee

Thread
MAX select problemLee Denny29 Jul
  • Re: MAX select problemJigal van Hemert29 Jul
  • Re: MAX select problemPhilippe Poelvoorde29 Jul