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

Home -> Community -> Usenet -> c.d.o.misc -> Re: A SQL question.

Re: A SQL question.

From: Alan D. Mills <alanmNOSPAM_at_uk.europe.mcd.mot.com>
Date: Fri, 18 Sep 1998 16:29:09 +0100
Message-ID: <6ttu71$r2$1@schbbs.mot.com>


If it's a SQL*Plus report then the obvious answer it to build a temporary table using PL/SQL first, with the data in and then report from that.

Loop through all records in the order you want them. Keep a copy of the 'Type' of the previous record. Add 1 to the type_count for each record retrieved in your cursor if the type of thelast record doesnl;t match the current one then reset count to 1.
Add record, along wiht counter, to a temp table.

When table is full, simply SELECT * FROM tab.

If it's a Reports 2.5 report then select the constant 1 as one of your select value and sum this column resetting at type. A lot easier.

--
Alan D. Mills

Zhang Yiquan wrote in message <36026ab1.3273792_at_news.singnet.com.sg>...
>Hi all.
>
>I would appreciate any help available on this problem.
>
>I have to print some data as a report using an SQL statement.
>It's a line-item and control break kind of report.
>For example I have these...
>
Received on Fri Sep 18 1998 - 10:29:09 CDT

Original text of this message

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