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

Home -> Community -> Usenet -> c.d.o.server -> Re: script for "data value, count(data value)"

Re: script for "data value, count(data value)"

From: Mark D Powell <mark.powell_at_eds.com>
Date: 14 Feb 2002 13:06:06 -0800
Message-ID: <178d2795.0202141306.7eb67fe8@posting.google.com>


miker <mdent12_at_none.com> wrote in message news:<r1ln6uo9ck9s0kb682it561r4tkgoa0n3o_at_4ax.com>...
> I can't seem to get a script that will list the data elements as well
> as give me the count for those data elements from a table. A
> sub-select gives error about not returning single row. TIA

Miker, your problem description sounds like you should be using a group by claude:

UT1> select deptno, count(deptno)
  2 from emp
  3 group by deptno
  4 /

    DEPTNO COUNT(DEPTNO)
---------- -------------

        10             3
        20             5
        30             6


HTH -- Mark D Powell -- Received on Thu Feb 14 2002 - 15:06:06 CST

Original text of this message

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