• Skip to primary navigation
  • Skip to main content

Tech Honey

The #1 Website for Oracle PL/SQL, OA Framework and HTML

  • Home
  • HTML
    • Tags in HTML
    • HTML Attributes
  • OA Framework
    • Item in OAF
    • Regions in OAF
    • General OAF Topics
  • Oracle
    • statement
    • function
    • clause
    • plsql
    • sql

syntax and example of CORR Function in oracle sql

CORR Function in Oracle SQL – PLSQL

November 27, 2012 by techhoneyadmin

The CORR Function in Oracle SQL / PLSQL is used to calculate the coefficient of correlation in a set of numbers.

Syntax for the using the CORR Function in Oracle SQL / PLSQL is:

SELECT CORR(n,m)[OVER analytic_clause]
FROM table_name;

  • n and m are numbers used to calculate the coefficient of correlation.
  • The CORR function in Oracle SQL / PLSQL requires at least 2 records or rows in a table.

Example:

Using CORR Function in Oracle SQL / PLSQL SELECT statement:

Suppose we have a table named ‘employee’ as shown below:

Employee_ID Employee_Name Salary Department Commission
101 Emp A 10000 Sales
102 Emp B 20000 IT 20
103 Emp C 28000 IT 20
104 Emp D 30000 Support
105 Emp E 32000 Sales 10
106 Emp F 40000 Sales 10
107 Emp G 12000 Sales 10
108 Emp H 12000 Support

If we write our CORR Function query as:

SELECT CORR(salary, commission)
FROM employee;

We will get ‘-0.174844651545059’ as output.


Filed Under: function Tagged With: CORR Function in oracle plsql, CORR Function in oracle sql, CORRPLSQL, how to use CORR Function in oracle database query, how to use CORR Function in oracle plsql, how to use CORR Function in oracle sql, syntax and example of CORR Function in oracle database query, syntax and example of CORR Function in oracle plsql, syntax and example of CORR Function in oracle sql, using CORR Function in oracle database query, using CORR Function in oracle plsql, using CORR Function in oracle sql

Copyright © 2025 · Parallax Pro on Genesis Framework · WordPress · Log in