Hi All,
I am trying to fetch first 10 employees from hr schema employees table using Model clause but even after restricting number of iterations it showing all rows in result set.
SELECT * FROM employees
WHERE rownum < 10
ORDER BY employee_id;
SELECT
*
FROM
employees
MODEL
DIMENSION BY(ROW_NUMBER() OVER( ORDER BY employee_id) AS rnk)
MEASURES(employee_id,CAST(NULL AS NUMBER) AS details)
RULES
ITERATE(10) UNTIL (employee_id[ITERATION_NUMBER] = 10)
(details[1] = employee_id[ITERATION_NUMBER+1]);