Query question.
From: Peter <yabing.bi_at_ncr.com>
Date: Thu, 6 Dec 2001 10:52:23 -0800
Message-ID: <3c0fbe6a_at_rpc1284.daytonoh.ncr.com>
Hi,
.....
....
Date: Thu, 6 Dec 2001 10:52:23 -0800
Message-ID: <3c0fbe6a_at_rpc1284.daytonoh.ncr.com>
Hi,
[Quoted] Say I have a table with OrderID, CustomerID and OrderAmount (and more item) [Quoted] with OrderID as pk, each customer(CustomerID) can have more than one orders, [Quoted] if I want to get the list of (distinct) CustomerID and OrderAmount which the [Quoted] accumulated OrderAmount for that customer is more than a certain number, what the query should be?
Sample table:
OrderID CustomerID OrderAmount
--------- ------------ --------------
1 100 10 2 101 9 3 100 6 4 102 13 5 101 11
.....
I want output of:
CustomerID Total OrderAmount
------------ --------------------- 100 16 101 20 102 13
....
Thanks,
Barry
Received on Thu Dec 06 2001 - 19:52:23 CET