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

Home -> Community -> Usenet -> c.d.o.tools -> Re: subracting numbers

Re: subracting numbers

From: Brian Peasland <peasland_at_edcmail.cr.usgs.gov>
Date: Wed, 24 Jan 2001 14:13:18 GMT
Message-ID: <3A6EE2FE.58C3AA02@edcmail.cr.usgs.gov>

Get a copy of Oracle8i The Complete Reference by Loney & Koch on Oracle Press.

HTH,
Brian

pankrateon_at_my-deja.com wrote:
>
> Thanks!!! That did it. Do you have and recomendations on
> books which would help me out with other issues of this nature that
> I might have in the future.
>
> In article <94ks00$i6e$1_at_nnrp1.deja.com>,
> Alex Filonov <afilonov_at_pro-ns.net> wrote:
> > Try:
> >
> > create view t_v as
> > select lastname, firstname, title, department,
> > nvl(sum(decode(pay_type, 'Gross', amount, 0)),0) -
> > nvl(sum(decode(pay_type, 'Bonus', amount, 0)),0)
 gross_no_bonus
> > from yourtable
> > group by lastname, firstname, title, department;
> >
> > In article <94khgr$7i4$1_at_nnrp1.deja.com>,
> > pankrateon_at_my-deja.com wrote:
> > > the stage:
> > > Oracle 8i 8.1.6
> > > a table that contains employee info of which there is one column
 labeled
> > > "pay type"
> > > The "pay type" can be "Gross" or "Bonus".
> > > An other field is "Amount"
> > >
> > > table looks like this:
> > >
> > > lastname | firstname | title| department | pay_type | amount
> > >
> > > I want to be able to group by the persons name (last and first) and
 then
> > > subract
> > > any "Bonus" amount from their "Gross" amount
> > >
> > > I would want to create a view that looks as follows:
> > >
> > > lastname | firstname | title| department | gross - amount
> > >
> > > how do I do that?
> > > is it possible have this displayed as a view?
> > >
> > > Sent via Deja.com
> > > http://www.deja.com/
> > >
> >
> > Sent via Deja.com
> > http://www.deja.com/
> >
>
> Sent via Deja.com
> http://www.deja.com/
 

-- 
========================================
Brian Peasland
Raytheons Systems at
  USGS EROS Data Center
These opinions are my own and do not
necessarily reflect the opinions of my 
company!
========================================
Received on Wed Jan 24 2001 - 08:13:18 CST

Original text of this message

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