Re: where clause help, please

From: Maxim Demenko <mdemenko_at_gmail.com>
Date: Thu, 03 Jan 2008 00:22:11 +0100
Message-ID: <477C1CA3.7030003@gmail.com>


Totti schrieb:
> hi all,
> i want to get the top 3 product that are the most sold, i want to use
> in the where clause, rowNum <= 3 but i dont know what is the exact
> syntax, my attempt is this:
>
> select Prod_Code , sum(qty) from purch
> group by Prod_Code
> order by sum(qty) desc
>
> and from this i want just the first 3, rowNum will do the thing in
> where but would you please tell me how to imply it properly?
>
> thanks.

Put your query into an inline view.
http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html

Best regards

Maxim Received on Wed Jan 02 2008 - 17:22:11 CST

Original text of this message