The requirement as follows.
take a table: Test1
Test1:
evntid date
11 12-jan-2000
11 null
11 13-dec-2008
------------------------------------
12 10-jan-2010
12 30-nov-2014
12 20-feb-2013
Requirement is Creation of Fast refresh MView with the following capabilities.
if u execute it like the following statement:
Select DECODE (COUNT(EVNTID),COUNT(DATE1),MAX(DATE1),NULL) FROM TEST1 WHERE EVNTID=12 ;
it should return the value: 30-nov-2014
Select DECODE (COUNT(EVNTID),COUNT(DATE1),MAX(DATE1),NULL) FROM TEST1 WHERE EVNTID=11;
it should return the value : (null)
But for us the problem is The mview will not accept the analytic functions usage in Fast refresh Mview.