Dustin Waybright thinks this is interesting:

You don’t always
care about guaranteeing deterministic or repeatable results; but if
you do, two options are available to you. One option is to ask to
include all ties with the last row by adding the WITH TIES option

From

Note

SELECT TOP (3) WITH TIES will cause any records with a repeating value in the ORDER BY statement to be brought in. For example, if the date is order by and 5 records have date 2009-01-01 you will get 5 and not 3.

Share this highlight

Get Instant Access Now

Unlock the rest of this book
and 30,000 other books and videos

By clicking this box, you confirm that you have read and agree to the terms and conditions of our Membership Agreement, and you understand that when your trial period ends, you will be required to provide billing information if you wish to continue using the service.