devxlogo

Three Ways to Limit Your Results in SQL Server 2016

Three Ways to Limit Your Results in SQL Server 2016

The query below uses TOP to select the TOP 3 students:

TOPSELECT TOP 3 *FROM Students;

The code below uses LIMIT to only show three records:

SELECT StudentName, StudentPercentageFROM StudentsLIMIT 3;

The query below uses RowNum to only show records 1 to 3

SELECT *FROM StudentsWHERE StudentPercentage  85 AND ROWNUM <= 3;
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist