MODEL Clause

Published July 26, 2025 By Sai Sree Ram Gundepudi

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]
  );

Was this solution helpful?

Your feedback helps improve our technical knowledge repository.

Share this article