标签:art 查询 over sql index sel select sql语句 日期
1、累计查询,每天的累计,分指标,分日期
主要关注一下:OVER、PARTITION BY
SELECT
INDEX_DAY,INDEX_PLAN_ID,INDEX_VALUE,SUM(INDEX_VALUE) OVER (PARTITION BY INDEX_PLAN_ID ORDER BY INDEX_DAY) SUM_VALUE
FROM
DW_INDEX_DAY
WHERE
INDEX_PLAN_ID
IN
(‘H03000100‘,‘H03000107‘)
标签:art 查询 over sql index sel select sql语句 日期
原文地址:http://www.cnblogs.com/jewsoft/p/7249316.html