PrepAway - Latest Free Exam Questions & Answers

Your database contains a table named Products that has columns named ProductID and Name.

Your database contains a table named Products that has columns named ProductID and Name.

You want to write a query that retrieves data from the Products table sorted by Name listing 15 rows at a time.

You need to view rows 31 through 45.

Which Transact-SQL query should you create?

PrepAway - Latest Free Exam Questions & Answers

A.


B.


C.


D.


A. Option A

B. Option B

C. Option C

D. Option D

Explanation:

The OFFSET-FETCH clause provides you with an option to fetch only a window or page of results from the result set. OFFSET-FETCH can be used only with the ORDER BY clause.

Example: Skip first 10 rows from the sorted resultset and return next 5 rows.

SELECT First Name + + Last Name FROM Employees ORDER BY First Name OFF

SET 10 ROWS FETCH NEXT 5 ROWS ONLY;

References: https://technet.microsoft.com/en-us/library/gg699618(v=sql.110).aspx


Leave a Reply