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

Home -> Community -> Usenet -> comp.databases.oracle -> Calculating SUM and COUNT in one statement

Calculating SUM and COUNT in one statement

From: Ford Desperado <ford_desperado_at_yahoo.com>
Date: 21 Feb 2004 14:36:37 -0800
Message-ID: <e96bc0d0.0402211436.5e27ebc7@posting.google.com>

Hi,

I need to retrieve
1. a total
SELECT SUM(COL1) FROM SOME_TABLE
2. most frequent values
SELECT COL1, COUNT(*) FROM SOME_TABLE GROUP BY COL1 I want to scan the table only once, so I was trying to accomplish both tasks in one statement. It's Oracle 9i
Any ideas?
TIA Received on Sat Feb 21 2004 - 16:36:37 CST

Original text of this message

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