SELECT TOP
SELECT TOP clause is used to specify the number of records to return from top of the table.
Syntax of TOP clause in SQL server –
SELECT TOP number|PERCENT ColumnName1,…,ColumnNameN
FROM <TableName>
WHERE<condition> ;
Example of TOP clause in SQL server –– To select top 10 records of customers from city Berlin from customers table
SELECT TOP 10 *
FROM Customers
WHERE city=‘Berlin’;
Example- To select top 10% records of customers from city Berlin from customers table
SELECT TOP 10 PERCENT *
FROM Customers
WHERE city=‘Berlin’;