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

Home -> Community -> Usenet -> comp.databases.theory -> Using DISTINCT AND SUM together SQL question

Using DISTINCT AND SUM together SQL question

From: Mia <mmiaa_at_cox.net>
Date: Fri, 12 Apr 2002 19:37:56 GMT
Message-ID: <3CB737B0.E737511D@cox.net>


Hi All,

I've got a large table that I'm trying to write a query for. I don't fully understand the grouping functions, and I'm having some trouble getting what I want from the table. The table contains many columns but I am only interested in 3 of them. Call them ITEM, REV, and QTY. I (simply) want to do a SUM(QTY), but only for distinct rows of ITEM and REV. That is to say,

SELECT DISTINCT ITEM, REV FROM ...
and for that matter also
SELECT DISTINCT ITEM, REV, QTY FROM ... both give me the rows I want. But how can I get SUM(QTY) for the whole set?

TIA, Mia Received on Fri Apr 12 2002 - 14:37:56 CDT

Original text of this message

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