Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Simple Top N question
On Wed, 10 Nov 1999 17:00:39 GMT, you wrote:
>Try this format:
>
>select cust, min(ordnum), max(quantity)
>from tbl
>group by cust;
>
>finds the Max quantity per customer,
>lists the lowest (or could be max) order number.
>
nope - that find the max qty / customer and the min ordnum / customer (the min's and max's are computed independent of eachother)...
That will give you (probably) an ordnum that goes with a different quantity (from different rows).....
I posted a couple of different queries to get these answers...
>Robert Proffitt
>Beckman Coulter
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
Thomas Kyte tkyte_at_us.oracle.com Oracle Service Industries Reston, VA USA
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Wed Nov 10 1999 - 12:36:25 CST
![]() |
![]() |