Re: Need Help with PL/SQL

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: 1996/10/23
Message-ID: <326d75a4.1184903_at_dcsun4>#1/1


In 7.1 and up you can simply:

select *
from (
 SELECT EO_SHIPPED.SHIP_DATE, COUNT(EO_SHIPPED.ORDERNUM) CNT  FROM WHISC.EO_SHIPPED EO_SHIPPED
 WHERE (EO_SHIPPED.SHIP_DATE >=ADD_MONTHS(SYSDATE,-5))

       AND (TO_CHAR(EO_SHIPPED.SHIP_DATE,'DAY') NOT LIKE 'S%')
        GROUP BY SHIP_DATE )

where rownum <= 100

On Tue, 22 Oct 1996 16:52:15 GMT, atyagi_at_mc.xerox.com wrote:

>
>
>Hi everybody,
>
> Thanks to all those who helped me last time. I have another question
>for you! I have written this query and I want to restrict the total number
>of records returned to exactly 100. I am trying and I can not make it work. I
>will greatly appreciate any suggestion.
>
>SELECT EO_SHIPPED.SHIP_DATE, COUNT(EO_SHIPPED.ORDERNUM)
>FROM WHISC.EO_SHIPPED EO_SHIPPED
>WHERE (EO_SHIPPED.SHIP_DATE >=ADD_MONTHS(SYSDATE,-5))
> AND (TO_CHAR(EO_SHIPPED.SHIP_DATE,'DAY') NOT LIKE 'S%')
> GROUP BY SHIP_DATE;
>
>You can email me directly to atyagi_at_mc.xerox.com or post the reply
>
>Thanks again
>
>Amit Tyagi
>
>Xerox Corp.
>
>

Thomas Kyte
Oracle Government
tkyte_at_us.oracle.com                          

http://govt.us.oracle.com

  • Check out Oracle Governments web site! ----- Follow the link to "Tech Center" and then downloadable Utilities for some free software...

statements and opinions are mine and do not necessarily reflect the opinions of Oracle Corporation Received on Wed Oct 23 1996 - 00:00:00 CEST

Original text of this message