Q

Retrieving the first two rows in a table

SQL Server Development expert Greg Low explains how to retrieve the first two rows in a table in SQL Server 2000.

How do I retrieve the first two rows in a table?
In SQL Server 2000 or later you use the TOP statement. For example:

SELECT TOP 2 * FROM authors ORDER BY au_lname,au_fname

View questions and answers from all of our SQL Server experts here.

This was first published in March 2006

Dig deeper on Microsoft SQL Server Database Development

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchBusinessAnalytics

SearchDataCenter

SearchDataManagement

SearchAWS

SearchOracle

SearchContentManagement

SearchWindowsServer

Close