From a 10,000 ft view:
a string comparison is being done between each Reach Report
values, and the results of each comparison are used to order the 4 rows (ORDER BY [Reach Report] DESC
).
REACH 2012-13
REACH 2011-12
REACH 2010-11
REACH 2009-10
Then, the first one is chosen and returned (SELECT TOP 1 [Reach Report]
).
2
solved SQL Server 2012 getting last row in table with no unique identifier [closed]