You have attempted to use an aggregate function (MIN( ), MAX( ), SUM( ), AVG( ), COUNT( ), NPV( ), STD( ) or VAR( )) in a GROUP clause.