Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: sql query

Re: sql query

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Tue, 18 Jun 2002 21:58:59 +0100
Message-ID: <1024433884.20070.1.nnrp-12.9e984b29@news.demon.co.uk>


You beat me to it.

There is also the option for TRUNC() truncating the date to the quarter - which might be faster.

However, the format MIGHT be 'QQ', and there is the problem that the dates that Oracle thinks are the first of each quarter may not be the ones required by the poster.

Something like:

    select trunc(date_col, 'QQ') , count(*)     from big_table
    group by trunc(date_col, 'QQ')
    ;

should do it.

--
Jonathan Lewis
http://www.jlcomp.demon.co.uk

Next Seminars
        UK            June / July
        Australia      July / August
http://www.jlcomp.demon.co.uk/seminar.html

Sybrand Bakker wrote in message ...

>
>>
>IIRC the to_char function still support the Q format model, where q is
>for quarter.
>
>Hth
>
>Sybrand Bakker, Senior Oracle DBA
Received on Tue Jun 18 2002 - 15:58:59 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US