Saturday 15 May 2010

sql - ORA-00979: not a GROUP BY expression error -


I have the error that i! Got not understand

The number of employees and conferences to demonstrate my question is I name which he had worked and that employees not directly working on any conference, so that staff Must have to display 0. The tables associated with this query are:

Employee_C Table:

  EID name salary middle ---------------- - ----- ----- E01 Wilson 53000 E02 Smith 48000 E01 E03 Jones 38000 E01 E04 Loftus 41000 E05 Fox 54000 E04 E06 Smith 45,000 E04 E07 Green 48000 E08 Fox 49000 E04 E09 Wolf 41000 E04 E10 Wang 32000 E01 E11 Philips 33000 E07 E12 Liu 27000 E07   

Deals_C table:

  EID Confid --- ------ E02 C0000l C0000l E03 E05 E06 C0000l C0000l E03 c00002 E08 c00002 E09 c00002 E10 c00002 E03 c00003 E05 c00003 E06 c00004 E08 c00005 E09 c00005 E10 c00005 E06 c00005 E11 c00006 E12 c00006 E05 c00007 E06 c00007 E08 c00007 E09 c00008 E10 c00008 E11 c00008 E02 c00009 E12 c00009 E10 c0001 0 E02 c00011 E03 c00011 E05 c00011 E12 c00012 E06 c00012   

SQL statements to me

  as the number of "conference" E.Name, D .Confid selection is included in the left externally from Employee_C E.Eid at Deals_C D = Eid Group by Ded Group; Error:  

Error:

E.Name, D.ConfID Selection * Error on Line 1: ORA-00979: A Group by Expression No

Please help! Thank you

You are not doing an overall job and you are using GROUP BY is not sELECT list on a column you need GROUP bY E.Name because it is in the selection column:

 < code> select E.Name, count (D.ConfID) "number of conferences" as E.eid = Dikid group Deals_C outer left side of Employee_C by e E.Name D;   

View

No comments:

Post a Comment