tag:blogger.com,1999:blog-5110857384844141930.post470078579239351932..comments2023-09-25T12:37:04.271+04:00Comments on Nitin's Tech Blog: Top-N queryNitin Reddy Katkamhttp://www.blogger.com/profile/09612217398194148324noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-5110857384844141930.post-63991938957932913052009-09-29T13:08:16.009+04:002009-09-29T13:08:16.009+04:00FYI, according to another article I read, with Ora...FYI, according to another article I read, with Oracle the ROWNUM is applied before any ORDER BY clause if you specify one; in this case you must use a nested select:<br /><br />SELECT *<br /> FROM<br /> (SELECT *<br /> FROM emp<br /> ORDER BY NVL(SALARY, 0) DESC)<br /> WHERE ROWNUM < 10;Blue Lightninghttps://www.blogger.com/profile/12270927787710836050noreply@blogger.com