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

Home -> Community -> Usenet -> c.d.o.misc -> Re: simple query help

Re: simple query help

From: fumi <fumi_at_tpts5.seed.net.tw>
Date: 31 Dec 1999 02:30:04 GMT
Message-ID: <84h4fc$6n6$3@news.seed.net.tw>

Gabriel Millerd <millerd_at_ns1.rli-net.net> wrote in message news:84do8m$blc$1_at_news.powerisp.com...
>
> i have a table as follows (#1). i would like to have a report
> that gave the following (#2). can anyone help me?
>
> (#1)
>
> dept dude status
> ==== ==== ======
> north, bob, i,
> north, jim, a,
> north, sam, i,
> north, jeff, a,
> north, mary, a,
> north, sal, a,
> east, mary, a,
> east, dwaine, i,
> east, tom, i,
> east, bill, i,
> east, chuck, a,
> south, matt, a,
> south, holly, a,
> west, joy, i,
> west, stacy, a,
>
> (#2)
>
> dept active inactive
> ==== ====== ========
> north 4 2
> east 2 3
> south 2 0
> west 1 1

select dept, count(decode(status, 'a', 1)) as active,

    count(decode(status, 'i', 1)) as inactive   from dept
  group by dept; Received on Thu Dec 30 1999 - 20:30:04 CST

Original text of this message

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