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: Peter Connolly <peter_at_wpi.edu>
Date: 2000/05/10
Message-ID: <Pine.OSF.4.21.0005101058310.13581-100000@wpi.WPI.EDU>#1/1

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-
>
>
Received on Wed May 10 2000 - 00:00:00 CDT

Original text of this message

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