SELECT year(日期)+'-'+month(日期),sum(數量) from 表 group by year(日期)+'-'+month(日期)
select convert(varchar(6),convert(datetime,日期),120)as 日期,sum(数量) from table1 group by convert(varchar(6),convert(datetime,日期),120)
SELECT convert(char(4),year(進廠日期))+'-'+convert(char(4),month(進廠日期)) from tblresume group by convert(char(4),year(進廠日期))+'-'+convert(char(4),month(進廠日期))
SELECT convert(char(4),year(日期))+'-'+convert(char(4),month(日期))﹐sum(數量) from 表 group by convert(char(4),year(日期))+'-'+convert(char(4),month(日期))
group by year(日期)+'-'+month(日期)
group by convert(varchar(6),convert(datetime,日期),120)
group by convert(char(4),year(進廠日期))+'-'+convert(char(4),month(進廠日期))
group by convert(char(4),year(日期))+'-'+convert(char(4),month(日期))