Home > DeveloperSection > Forums > Return Top Five Recodrs From Table
Anoop Singh
Anoop Singh

Total Post:12

Points:84
Posted on    October-08-2010 7:40 AM

 MSSQL Server MSSQL Server 
Ratings:


 1 Reply(s)
 1199  View(s)
Rate this:
Hi All,

Could anyone please help me out. How to query in sql server 2008 to get
top 5 records.

thanks


Alex R
Alex R

Total Post:40

Points:280
Posted on    October-08-2010 9:24 AM

Hi Anoop,

You can select top 5 records from your table by using sql server top(<number of rows>) function.

Here is an example, which selects top 5 records from table student_record.

select

top(5) * from student_record

Don't want to miss updates? Please click the below button!

Follow MindStick