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_at_cox.net>
Hi All,
Date: Fri, 12 Apr 2002 19:37:56 GMT
Message-ID: <3CB737B0.E737511D_at_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 ...
TIA, Mia Received on Fri Apr 12 2002 - 21:37:56 CEST