How to get top n records
Database
2
Posts
2
Posters
0
Views
1
Watching
-
Hi All i want to get top 5 records from the table. what would be the query? Regards Qaiser
-
Hi All i want to get top 5 records from the table. what would be the query? Regards Qaiser
Returning only the first N records in a SQL query differs quite a bit between database platforms. Here's some samples: Microsoft SQL Server
SELECT TOP 10 column FROM table
PostgreSQL and MySQLSELECT column FROM table LIMIT 10
OracleSELECT column FROM table WHERE ROWNUM <= 10
SybaseSET rowcount 10 SELECT column FROM table
FirebirdSELECT FIRST 10 column FROM table
Tirtha Do not go where the path may lead, go instead where there is no path and leave a trail. Author: Ralph Waldo Emerson (1803-82), American writer, philosopher, poet, essayist