SQL SERVER 查询语句

一、查询某一年的每月汇总数据

SELECT CONVERT(CHAR(7), FinishDate,120) as FinishDate, SUM(Amount) as Amount,convert(varchar,100*SUM(Amount)/65000000)+'%' as Ratio FROM Consignment where year(FinishDate)=2015 GROUP BY CONVERT(CHAR(7), FinishDate,120) order by FinishDate

posted @ 2017-03-02 11:51  周佳洪  阅读(261)  评论(0编辑  收藏  举报