select year as ‘년’, month as ‘월’, count(*) as count from ( select YEAR(us.fd_dtcreate) as ‘year’, MONTH(us.fd_dtcreate) as ‘month’ from tb_ykfile as us where us.fd_dtCreate > ‘2020-08-01’ and us.fd_dtCreate <= ‘2022-01-01′ ) tb group by year, month order by year, month ; SELECT CONVERT(varCHAR(10),Dateadd(d, a.number,’2020-08-01 00:00:00’),120) AS dt ,Isnull(b.count, 0) AS count FROM master..spt_values […]
