Skip to content
Advertisement

How to resolve ORA-00979 not a GROUP BY expression [closed]

I am getting ORA-00979 with the following query:

select Unit , count(samid_rfpid) ,  (tcv+tcv_euro) as total from Closerfprfx GROUP BY Unit

je veux voir tous les nuits sans doublons , avec un total de leur tcv et tcv_euro ainsi que le nombre sam_rfpid quand j’ajoute tcv_euro et tcv dans groupe by j’ai pas le bon affichage :

 Unit count total
  CCF   1     500
CCF   1     500
CCF   1     500
CCF   1     500
CCF   1     500

the correct display :

Unit  count    total
CCF   5            56140

please what i should to do to resolve this error

Advertisement

Answer

You need to use aggregate function:

SELECT UNIT,
       COUNT(SAMID_RFPID),
       SUM(TCV + TCV_EURO) AS TOTAL -- here
  FROM CLOSERFPRFX
 GROUP BY UNIT
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement