O'Reilly logo
  • 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


Cover of Training Kit (Exam 70-461): Querying Microsoft® SQL Server® 2012


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.