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 Plus Reporting

Re: SQL Plus Reporting

From: Chrysalis <cellis_at_clubi.ie>
Date: Wed, 02 Sep 1998 00:43:04 +0100
Message-ID: <cellis-ya02408000R0209980043040001@news.clubi.ie>


In article <6shqst$gge$1_at_nnrp1.dejanews.com>, vishmok_at_my-dejanews.com wrote:

> Hi!
>
> I want to generate a a tabular report using SQL Plus 3.3.
> This report requires separate select statement for each column of report, on
> same table.
>
> e.g.
>
> U_Valus Null_Values Z_Values >>>>>>> Report Headings
> R1 R2 R3 >>>>>>> Entries on the report
>
>
> Here R1 is
> "Select count(*)from table where table.column1 = "U";
> Here R2 is
> "Select count(*)from table where table.column1 is null;
> Here R3 is
> "Select count(*)from table where table.column1 = "Z";
>
>

select sum(decode(column1,'V',1,null)) "V_Values"
      ,sum(decode(column1,null,1,null)) "Null_Values"
      ,sum(decode(column1,'Z',1,null)) "Z_Values"
from table
[where (column1 in ('V','Z') or column1 is null)] -- optional

HTH
Chris Ellis Received on Tue Sep 01 1998 - 18:43:04 CDT

Original text of this message

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