Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL HELP
Use the TRUNC function :
select count(order_id), trunc(order_date)
from order_record
where trunc(order_date) > date1
and trunc(order_date) < date2
group by trunc(order_date);
HTH
Min Wang <mwang_at_colorbank.com> wrote in article
<35DCB6BF.46B891E7_at_colorbank.com>...
> Hi:
>
> I have a query like this:
>
> select count(order_id), order_date
> from order_record
> where order_date > date1
> and order_date < date2
> group by order_date;
>
>
> What I want is get the numbers of orders for each day from date1 to
> date2.
> But what I get is a individaul order list instead of the sum of order of
> each day. I guess this may be because I used sysdate when I record the
> orders. Some orders might be placed in the same day but at different
> time.
>
> My question is how I can get count(order_id) for each day?
>
> Thanks.
>
Received on Fri Aug 21 1998 - 01:43:32 CDT
![]() |
![]() |