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 -> Average number of rows

Average number of rows

From: Peter Amberg <son42uk_at_yahoo.co.uk>
Date: 12 Nov 2003 02:47:50 -0800
Message-ID: <f8232d10.0311120247.3da5d273@posting.google.com>


I have a table T with a column C. The values of C are not distinct, ie. there are several rows with the same value of C. I want to calculate the average number of rows with a distinct value of C. For instance,

Row | C
----+---

  1 | 1
  2 | 1
  3 | 1
  4 | 2
  5 | 9
  6 | 9

The value I want to calculate is 6 rows / 3 distinct values = 2. Received on Wed Nov 12 2003 - 04:47:50 CST

Original text of this message

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