Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL Statement problem
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