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: Help with SQL statement, please!

Re: Help with SQL statement, please!

From: Newbie \(Joe \) <jranseth_at_hotmail.com>
Date: 2000/06/30
Message-ID: <4P275.338$Hs3.7363@news1.mts.net>#1/1

Matt, that didn't seem to work with what I already have.....perhaps it will be different when you see what I have already?

--
Joseph Ranseth - Webmaster
World Cup Fishing
Phone:(204) 944-8945 Fax: (204) 943-0954
http://www.worldcupfishing.com
"Matt B." <mcb_at_fightspam.sd.znet.com> wrote in message
news:slpcbqpsjev115_at_corp.supernews.com...

> "Newbie (Joe )" <jranseth_at_hotmail.com> wrote in message
> news:jg275.334$Hs3.7458_at_news1.mts.net...
> > Hello,
> > I want to select rows from a table where only one field is
unique...ie:A
> > customer may have several purchases, but I want to return only the
biggest
> > purchases per customer.
> > I currently have it returning all purchases for every customer, but
> > would like to see only the max value per customer. Here's what I have:
> >
> > --
>
> Hmmmm...you don't have much. :-)
>
> Try (assume table is "purchases" with "customer_code" and "sale_amount"
> columns):
>
> select customer_code, max(sale_amount)
> from purchases
> group by customer_code;
>
> -Matt
> >
Received on Fri Jun 30 2000 - 00:00:00 CDT

Original text of this message

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