Loading, please wait...

Top Clause

How To Use Top Clause In SQL

 

Introduction:
In this article, you will learn, what top clause is and how to use top clause in SQL.

This clause is used to find out the top of the data in the existing table. Different types of database support different statement for top clause (like – MySQL allows the limit clause to carry the data and Oracle allows the row to carry the data).

 

Syntax

The basic syntax of a top clause with the select statement is as follows:

select top number|percent from table_name;

 

Example

In this query, we find out the first 3 records of the employee.

 

Step 1: We write our query.

 

 

 

Now, select and execute this.

 

Step 2: Then the output is:

 

 

 

Summary:
Thus, we learned that top clause is used to find the starting data in SQL.