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: SQL Statement problem

Re: SQL Statement problem

From: <emaus081269_at_my-deja.com>
Date: 2000/05/10
Message-ID: <8fci7h$utn$1@nnrp1.deja.com>#1/1

What if you don't know the name of the field. It comes from the database?

In article <Pine.OSF.4.21.0005101058310.13581-100000_at_wpi.WPI.EDU>,   Peter Connolly <peter_at_wpi.edu> wrote:
> The following will do it assuming you know the category types ahead of
> time:
>
> SELECT
> sum(decode(w.cat_type,'TRAINING',1,0))/count(*) as
 PCT_TRAINING,
> sum(decode(w.cat_type,'TECHNICAL',1,0))/count(*) as
 PCT_TECHNICAL,
> ...
> FROM
> workload w
>
> On Wed, 10 May 2000, miike wrote:
>
> > I have a table (workload) that has a column (category_type) that
 has 5
> > different possible entries(training, technical, clerical,
 operations,
> > supply). Is there a way to write a SQL statement to get a listing by
> > percentage of each entry type (i.e. training =25%, technical=30%,
 etc)
> > so that I can create a piechart to give my supervisor?
> > TIA.
> > -mike-
> >
> >
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed May 10 2000 - 00:00:00 CDT

Original text of this message

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