Date: Sat, 27 Oct 2001 18:52:51 +0200 (MEST) From: Christian_Seidl@gmx.de Message-ID: <10222.1004201571@www12.gmx.net> Subject: Re: [suse-oracle] Can oracle group by more then one column?
Hi,
if the column date_taken is a date with timestamp you can use the
TRUNC-function to eliminate the seconds.
example:
select class_id, TRUNC(date_taken) date_taken, count(er_id) cntexams
from exam_result
where exam_type = 8
group by class_id, TRUNC(date_taken) ;
sorry for the bad english.
Christian Seidl
seidlc@gmx.de
> This seems like a stupid question to me because every
> database i have worked with can do this but its not
> working in oracle.
>
> I have a table called exam_result and this is my query
>
> select class_id, date_taken, count(er_id) cntexams
> >from exam_result
> where exam_type = 8
> group by class_id, date_taken;
>
>
> class_id date_taken cntexams
>
> 7131 23-MAR-00 1
> 7131 23-MAR-00 1
>
> Why is this not aggregating?
> I should be getting
> 7131 23-MAR-00 2
> It works if i only use class_id but when i use 2
> columns it no longer does a count.
>
> Any suggestions would be greatly appreciated as i have
>
> been killing myself over this.
>
> -Kyle
>
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: suse-oracle-unsubscribe@suse.com
> For additional commands, e-mail: suse-oracle-help@suse.com
>
-- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net--------------------------------------------------------------------- To unsubscribe, e-mail: suse-oracle-unsubscribe@suse.com For additional commands, e-mail: suse-oracle-help@suse.com
This archive was generated by hypermail 2.1.0 : Sat Oct 27 2001 - 09:52:01 PDT