OVER clause in Oracle

前端 未结 3 1530
面向向阳花
面向向阳花 2020-11-29 19:16

What is the meaning of the OVER clause in Oracle?

3条回答
  •  执笔经年
    2020-11-29 19:31

    You can use it to transform some aggregate functions into analytic:

    SELECT  MAX(date)
    FROM    mytable
    

    will return 1 row with a single maximum,

    SELECT  MAX(date) OVER (ORDER BY id)
    FROM    mytable
    

    will return all rows with a running maximum.

提交回复
热议问题