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:
The query above will return the first 10 rows from the Customers table.
Related Databases job interview questions
What is DISTINCT and what is good for?
DatabasesMS SQL ServerQuality Assurance (QA) JuniorWhat is TOP and what is it good for in SQL server script?
DatabasesQuality Assurance (QA) JuniorHow can you select rows from the database table using a script using SELECT?
DatabasesQuality Assurance (QA) JuniorHow do you insert rows using a script using INSERT in SQL?
DatabasesQuality Assurance (QA) JuniorWhat are 3 block notation, 2 block notation, 1 block notation and understand the difference?
DatabasesQuality Assurance (QA) Junior