SQL SELECT TOP clause is used to specify the number of records to return

SQL SELECT TOP clause is used to specify the number of records to return

Syntax:

SELECT TOP  column_name
FROM table_name
WHERE condition

Example:

The following SQL statement selects the first two records from the "Customers" table

SELECT TOP 2 * FROM Customers
SELECT TOP 2 * FROM Customers
WHERE Country='India';

SQL statement selects the first 40% of the records from the "Customers" table

SELECT TOP 40 PERCENT * FROM Customers

 

 

2020-03-28