Laurent Schneider :
happy april fool of course
The query is perfectly fine to count all invalid objects in the current schema. The error and banner were fake of course
…
Adding a GROUP BY clause will suppress the output when no invalid object exists…
…

em ?
sorry, but I don’t understand it does not work for me:

sql > select user,count(*) from dual group by user;

USER COUNT(*)
—————————— ———-
SOKRATES 1

sql > select count(*) from dual where dummy=’X’;

COUNT(*)
———-
1

sql > select user,count(*) from dual where dummy=’X’ group by user;

USER COUNT(*)
—————————— ———-
SOKRATES 1

sql > select user,count(*) from user_objects where status=’INVALID’;

USER COUNT(*)
—————————— ———-
SOKRATES 2

sql > select user,count(*) from user_objects where status=’INVALID’ group by user;

It if of course wrong 😉 It is not group function. User is not variable, but function, you can not use group by when rows can be different and you have no this column in group by. That is right. USER = not variable, function, it same as you can select this: