Using SQL query, how do you limit number of returned rows using TOP(x)?

Experience Level: Junior
Tags: DatabasesMS SQL ServerQuality Assurance (QA)

Answer

The TOP statement is used in the following way:

Query
SELECT TOP(10) * FROM Customers

The query above will return the first 10 rows from the Customers table.

Related Databases job interview questions

Comments

No Comments Yet.
Be the first to tell us what you think.
MS SQL Server for Testers
MS SQL Server for Testers

Are you learning Databases ? Try our test we designed to help you progress faster.

Test yourself