Top 10 syntax (Oracle and SQL)
As my experience in Microsoft development, I was think that the syntax for retrieving top 10 records in SQL server is same with Oracle but unfortunately they were different so here the syntax of both :
SQL SERVER :
SELECT TOP 10 age FROM Employees
ORACLE :
SELECT age FROM Employees WHERE ROWNUM <= 10
1 comment:
Oracle statement should not work, because Oracle returns data in random order. You have to order the data in a subquery before getting the top N rows.
Post a Comment