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

Home -> Community -> Usenet -> c.d.o.misc -> Re: a Max fonction in sql ?

Re: a Max fonction in sql ?

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 1 Nov 2002 10:39:22 -0800
Message-ID: <2687bb95.0211011039.42ad7fc6@posting.google.com>


"Richard Foote" <richard.foote_at_bigpond.com> wrote in message news:<0htw9.67160$g9.188746_at_newsfeeds.bigpond.com>...
> Hi locnet,
>
> Why not try out your SQL.
>
> You'll be pleasantly surprised ;)
>
> Richard
> "locnet " <"locnet "@free.fr> wrote in message
> news:3DC3A25F.9030304_at_free.fr...
> > My table is
> >
> > article | price
> > --------------
> > car | 1000
> > car | 800
> > car | 900
> > bicycle | 50
> > bicycle | 60
> > bicycle | 20
> > train | 7000
> >
> >
> > and I want the bigger price for each article :
> >
> > article | price
> > --------------
> > car | 1000
> > bicycle | 60
> > train | 7000
> >
> > I'd like something like a hypothetic MAX function that work on group :
> > SELECT article, MAX(price)
> > FROM table
> > GROUP BY article
> >
> > Does something similar existe ?
> >
> >
> > Thanks.
> >

As Dave and Richard pointed out your query will work as is. You can find the single and aggregate row functions available to you in the Oracle SQL manual. Oracle supports all the ANSI aggregate functions like min, max, avg, sum ....

HTH -- Mark D Powell -- Received on Fri Nov 01 2002 - 12:39:22 CST

Original text of this message

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