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โ;
Leave a Reply