例 - Teradata Database - Teradata Vantage NewSQL Engine - ウィンドウ機能の例。

Teradata Vantage™ SQL関数、演算子、式および述部

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
2019年3月
Language
日本語
Last Update
2019-10-29
dita:mapPath
ja-JP/xzf1512079057909.ditamap
dita:ditavalPath
ja-JP/xzf1512079057909.ditaval
dita:id
B035-1145
Product Category
Software
Teradata Vantage

次の例は、各地域の売上げ上昇の全期間の累積売上げを検索します。

   SUM(sales) OVER (
        PARTITION BY region
        ORDER BY day_of_calendar
        RESET WHEN sales < /* preceding row */ SUM(sales) OVER (
             PARTITION BY region
             ORDER BY day_of_calendar
             ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING)
        ROWS UNBOUNDED PRECEDING
   )