mysql month()
Posted: Fri Nov 21, 2003 10:10 am
Looking for the most efficient mysql query for month comparison -
I am pulling from tables with minimum 200k records and performing multiple queries for building site useage reports.
Do you know a more efficient way to write this query?
thanks in advance..
I am pulling from tables with minimum 200k records and performing multiple queries for building site useage reports.
Do you know a more efficient way to write this query?
Code: Select all
$query = "SELECT COUNT(DISTINCT user_id) as monthusers FROM Activity WHERE MONTH(last_visit)=MONTH(NOW())";