aafighting(提问者)WITH temp1 AS(
SELECT a.[year],
a.[day],
a.[values],
(CASE
WHEN a.[month]<10THEN \'0\'+a.month
ELSE a.[month]
END) as [month]
FROM year_month_1 a
),
temp2 AS(
SELECT DATENAME(mm,GETDATE()) as month_1
)
SELECT
(a.[year]+\'年当月\') as [year],
a.[month],
a.[day],
a.[values]
FROM temp1 a,temp2 b
WHERE a.[month]=b.month_1
ORDER BY a.year,a.[month]