Today a colleague of mine was trying to pick the top row in a result set on SQLServer, and we being Oracle Database fans could only think of ROWNUM. So here is what we found out after digging for some time.
Rownum is used in Oracle to retrieve the N-top records.
SELECT * FROM TABLENAME
WHERE ROWNUM<2
Note: Some [...]
Archive for the ‘SQL’ Category
“ROWNUM” in Oracle is equivalent to “TOP N” is SQLServer
Posted in SQL, tagged Oracle, rownum, SQL, SQLServer, top n on August 12, 2008 | 6 Comments »