All Type Coding

Search Here

TOP Clause in sql server.


TOP Clause:

The SELECT TOP clause can be very useful on large tables with thousands of records.The SELECT TOP clause is used to specify the number of records to return or TOP clause is used to fetch a TOP N number.

Syntax:

           Select TOP number * from  table_name  where [Condition]

For Example: 
             
          select top 3 * from Employee1
Let's Consider the Employee1 table having the following records:











Now we'll select top 3 records from the Employee1 table.











Thus by  the top clause we can select  to specify the number of records from the table.


No comments :

Post a Comment