以下是按年、按季度和按月统计SQL查询语句: 按年统计: SELECTds.checker,YEAR(ds.create_time) AS settleYear,SUM(ds.quantity) AS quantity,SUM(ds.approval_price) AS approvalPriceFROMdata_settle dsWHEREds.delete_flag = 0AND ds
1、根据公司和日期分组 获得发票数据量 SELECT PAY_TAXES_ORGNAME, --BILLING_NO, LEFT(INVOICE_OPEN_DATE,7) AS MM, COUNT(1) AS NUM --,INVOICE_STATE, --sum(case when INVOICE_STATE=1 then 1 else 0 end) AS 蓝票,