SQL tutorial | Interview questions | Oracle
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Can Group Functions Be Mixed with Non-group Selection Fields?

Go down

Can Group Functions Be Mixed with Non-group Selection Fields? Empty Can Group Functions Be Mixed with Non-group Selection Fields?

Post by Micheal Sun Jan 17, 2010 3:06 am

If a group function is used in the SELECT clause, all other selection fields must be group level
fields. Non-group fields can not be mixed with group fields in the SELECT clause. The script
below gives you an example of invalid SELECT statements with group and non-gorup selection
fields:
SQL> SELECT COUNT(*), department_id FROM departments;
ORA-00937: not a single-group group function
In this example, COUNT(*) is a group field and department_id is a non-group field.

Micheal
Admin

Posts : 243
Join date : 2010-01-10

http://sql-tutorial.co.cc

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum