Hi All,
Question I am able to resolve with simple sql but this is just for learning purpose.
While pulling department who hired maximum number of employees in year mentioned error is coming, why it's coming and how I can avoid it using hint shown in error message.
select *
from employees
model
dimension by ( department_id, to_char(hire_date,'YYYY') as h_year)
measures (0 as cnt, 0 as rnk)
rules
(
cnt[any, any]=count(cnt)[any, cv()],
rnk[any, any]=dense_rank() over (order by cnt desc));
ORA-32638: Non unique addressing in MODEL dimensions
32638. 00000 - "Non unique addressing in MODEL dimensions"
*Cause: The address space defined for the MODEL (partition by and dimension by
expressions) do not uniquely identify each cell.
*Action: Rewrite the MODEL clause. Using UNIQUE SINGLE REFERENCE
option might help.