This content has been marked as final. Show 2 replies
choti wrote:That's right. It's documented in the SQL language manual
ORA-00934: group function is not allowed here
create index idx_emp on emp(max(install_time))
MAX is an aggregate function.
Restrictions on Function-based Indexes Function-based indexes are subject to the following restrictions: ... The column_expression cannot contain any aggregate functions.
What business problem are you trying to solve? If you could create an index like that, how would you use it?
Explain what you need to do, and someone will help you find a good way to do it.
Frank is correct but if you really need this the solution is to create a materialized view based on the SQL statement that will perform the aggregation.
By enabling query rewrite you will be able to write queries directed at the table and Oracle will rewrite the query to obtain the result from the MV.