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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Calculating unique sums

Re: Calculating unique sums

From: <gmei_at_my-deja.com>
Date: Wed, 29 Nov 2000 03:04:32 GMT
Message-ID: <901rnt$vkg$1@nnrp1.deja.com>

Is

select distinct customer_id, product_id
from transaction table
order by customer_id, product_id

what you want?

Hope this helps.

Guang

In article <3A2415EC.4B55861A_at_weinerfamily.org>,   sw_at_weinerfamily.org wrote:
> I have a transaction table: transaction_id,product_id,customer_id.
> I want to get list of UNIQUE customers (not # of transactions) that
> purchased each product.
> The result may look something like this:
> Product Customer Count
> A 500
> B 23
> C 175
>
> Does anyone have advice on the most efficient way to do this? I am
> dealing with hundreds of millions of transactions.
>
> Thanks
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Nov 28 2000 - 21:04:32 CST

Original text of this message

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