On Tue, 1 May 2001, Graham Nichols wrote:
> I have a table which contains a date column and an order_number column. I
> need to formulate a query syntax to return the total number of orders for
> each day in a given month (if any). Can someone help me with the syntax
> please as I've been stumbling around with it all day without success.
>
> Many thanks, Graham
select data_column,count(*) as number_of_orders
from my_table
where MONTH(date_column)=#
group by TO_DAYS(date_column);
and you replace the # with the month number you are looking for
regards,
thalis
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php