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: problem with view

Re: problem with view

From: Ty O'Kelly <tokelly_at_openplus.com>
Date: Fri, 16 Jul 1999 09:25:26 -0500
Message-ID: <378F40D6.B2799AAD@openplus.com>


things like that always make so much sense after you see it done.

thanks for the help!

ty

Kenneth C Stahl wrote:

> You can't do it that way. Do it like this:
>
> create view irlinev10 as
> select b.realm,
> a.costctr,
> a.chart,
> a.account,
> a.subacct,
> sum(decode(c.approvedby,NULL,a.amount,0)) unapprovedamt,
> sum(decode(c.approvedby,NULL,0,a.amount)) approvedamt
> from irline a,
> costctr b,
> itemreq c
> where b.costctr = a.costctr and
> c.request = a.request
> group by b.realm,
> a.costctr,
> a.chart,
> a.account,
> a.subacct
> /
>
> Ty O'Kelly wrote:
>
> > i am having difficulty with the following view. oracle does not like
> > the "NOT NULL" i have in the second decode statment. can any of you
> > gurus tell me what i am doing wrong?
> > create view irlinev10 as
> > select b.realm,
> > a.costctr,
> > a.chart,
> > a.account,
> > a.subacct,
> > sum(decode(c.approvedby,NULL,a.amount,0)) unapprovedamt,
> > sum(decode(c.approvedby,NOT NULL,a.amount,0)) approvedamt
> > from irline a,
> > costctr b,
> > itemreq c
> > where b.costctr = a.costctr and
> > c.request = a.request
> > group by b.realm,
> > a.costctr,
> > a.chart,
> > a.account,
> > a.subacct

--
Ty O'Kelly
tokelly_at_openplus.com Received on Fri Jul 16 1999 - 09:25:26 CDT

Original text of this message

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