| Posted by Bill on 10/18/06 13:58 
Try something of the format:
 SELECT  cs.cus_id, cs.cus_name, sum(sales) as sales
 FROM    cus_sales cs
 INNER JOIN ( SELECT sum(sales) tot_sales FROM cus_sales ) ts
 ON   cs.sales >= ts.tot_sales * .6
 
 kansaskannan@gmail.com wrote:
 > I have an Access 2000 database which lists customers by name, and how
 > much (in dollars) they have purchased of various products.  How do I
 > write a SQL statement to select customers who make up the top 60% of
 > total sales dollars?  I need to have a list of customers returned.
 >
 > The list of customers that get returned will be used to select other
 > data from the same database. (I mention this in case there are multiple
 >
 > ways of getting the customer list).
 >
 >
 > Thank you for any advice.
  Navigation: [Reply to this message] |