Home Forums SQL Server 2012 SQL Server 2012 - T-SQL order by desc and asc on same column RE: order by desc and asc on same column
serg-52
SSCrazy Eights
Points: 9913
More actions
June 24, 2015 at 1:11 am
#1807638
declare @currentWeek int =26
select ...
from (...) as t -- selects exactly 52 rows you need
order by case when @currentweek >= t.week then 100+t.week else t.week