SELECT OBJECT_NAME, STATUS, OBJECT_TYPE FROM ALL_OBJECTS WHERE OBJECT_TYPE <> 'VALID' GROUP BY OBJECT_TYPE
*
ERROR at line 1:
ORA-00979: not a GROUP BY expression
What's wrong?
Printable View
SELECT OBJECT_NAME, STATUS, OBJECT_TYPE FROM ALL_OBJECTS WHERE OBJECT_TYPE <> 'VALID' GROUP BY OBJECT_TYPE
*
ERROR at line 1:
ORA-00979: not a GROUP BY expression
What's wrong?
your error is really:
This is telling you that "OBJECT_NAME" is not a GROUP BY expression.Code:SQL> l
1 SELECT OBJECT_NAME, STATUS, OBJECT_TYPE
2 FROM ALL_OBJECTS
3 WHERE OBJECT_TYPE <> 'VALID'
4* GROUP BY OBJECT_TYPE
SQL> /
SELECT OBJECT_NAME, STATUS, OBJECT_TYPE
*
ERROR at line 1:
ORA-00979: not a GROUP BY expression
I suggest you look at the group by clause in the docs at http://tahiti.oracle.com
I still don't understand....Please guide..
I just want to group by object_type
I suggest you look at the group by clause in the docs at http://tahiti.oracle.com
What do you understand the GROUP BY clause does? You're not confusing it with ORDER BY, are you?Quote:
Originally posted by WilliamLWY
I still don't understand....Please guide..
I just want to group by object_type
Of course not..
beat you this time fingers...
So if you know what GROUP BY does, you know why its wrong...Quote:
Originally posted by WilliamLWY
Of course not..
Still don't know
There are several type of object_type, I just group by object_type instead of object_name. Why it say object_name not a group by expression?
I suggest you look at the group by clause in the docs at http://tahiti.oracle.com