Oracle SQL MODEL Clause

The MODEL clause lets you perform cell-based calculations using formulas similar to those in Excel.

SELECT department_id, year, profit
FROM sales
MODEL
  PARTITION BY (department_id)
  DIMENSION BY (year)
  MEASURES (profit)
  RULES (
    profit[2024] = profit[2022] + profit[2023]
  );