with ,Row_Number,DateDiff,DateAdd用法学习
with tabs as ( select row_number() over (order by name) as rowNum , convert(varchar(10),dateadd(dd,number,convert(varchar(8),getdate(),120)+'01'),120) as dt from master..spt_values where type='P' and dateadd(dd,number,convert(varchar(8),getdate(),120)+'01')<=dateadd(dd,-1,convert(varchar(8),dateadd(mm,1,getdate()),120)+'01') ) select * from tabs where rowNum%2>0