Learn Oracle Analytic functions

Source: Internet
Author: User

Oracle provides a number of powerful analytic functions that can be used to accomplish requirements that may require a stored procedure to be implemented.

The analytic function calculates the aggregated values based on a set of data rows, which are different from the aggregate functions, and they return multiple rows of results for each group. The parse function is executed last in the query statement except for the ORDER BY clause. All joins and all where, GROUP by and having clauses are executed before the parse function. Therefore, the analysis function can only appear in the Select or ORDER BY clause.

All parts:

Analytic_function

Specify the name of the parse function, followed by all the analysis functions

Arguments

Analysis functions can have between 0 and 3 parameters. A parameter can be any numeric type or other non-numeric type that can be implicitly converted to a numeric type.

Analytic_clause

Using over analytic_clause indicates that a function operation is a query result set. If you want to filter query results based on analytic functions, you need to use nested subqueries.

Query_partition_clause

Use the partition BY clause to group the query result set based on one or more value_expr. If omitted, the parse function treats all rows as a group.

Order_by_clause

Use Order_by_claus to specify how the data is sorted in a group.

ASC (default) | DESC

NULLS First (default in DESC) | NULLS last (default in ASC)

Windowing_clause

Partial parsing functions allow the use of the Windowing_clause clause.

This clause can be specified only if Order_by_clause is specified.

rows specifies the window that uses the physical row

range specifies a window with a logical offset

Learn Oracle Analytic functions

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.