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โ;
Saraswat World Changed status to publish June 14, 2023
Leave a Reply