I am getting ORA-00979 with the following query:
x
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