Analytical Functions

Published September 09, 2026 By Sai Sree Ram Gundepudi

Introduction to Analytical Functions

These functions compute values across rows while retaining detail records. They're useful in reporting, ranking, and trend analysis.

Used with OVER() clause and optional PARTITION BY, ORDER BY.

SELECT employee_id, department_id, salary, 
       AVG(salary) OVER (PARTITION BY department_id) AS dept_avg
FROM employees;

Was this solution helpful?

Your feedback helps improve our technical knowledge repository.

Share this article