发布于 2017-07-17 21:30:01
假设您没有可以使用的带有日期的表,您可以这样做
SELECT * FROM (
select YEAR(getdate()) as [TimePeriod]
UNION SELECT YEAR(getdate()) -1
UNION SELECT YEAR(getdate()) -2
UNION SELECT YEAR(getdate()) -3
UNION SELECT YEAR(getdate()) -4
) t
ORDER By TimePeriod DESChttps://stackoverflow.com/questions/45143546
复制相似问题