Oracle Cumulative SUM analysis function sum over the use of ___ static function

Source: Internet
Author: User

Example 1:select deptno,ename,job,sal,sum (SAL) over (order by Sal) his from EMP; Results: SMITH Clerk JAMES Clerk 950 1750 ADAMS Clerk 1100 2850 WARD salesman 1250 5350 MARTIN salesman 1250 5350 MILLER Clerk 1300 6650 TURNER salesman 1500 8150 ALLEN salesman 1600 9750 example 2:select deptno,ename,sal, SUM (SAL) over (partition by the Deptno order by ename) his from EMP; Result: CLARK 2450 2450 KING 5000 7450 MILLER 1300 8750 ADAMS 1100 1100 FORD 3000 4100 JONES 2975 7075 SC OTT 3000 10075 SMITH 10875 ALLEN 1600 1600 BLAKE 2850 4450

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.