Average

Asked

Viewed 51 times

-3

Good Afternoon! I need to calculate the average of this calculated column.

SELECT 
RESUMO.CODCOLIGADA,
RESUMO.ID_CCUSTO,
RESUMO.CODCCUSTO,
RESUMO.NOME,
RESUMO.DTBAIXA,
SUM (RECEITAS) AS RECEITAS,
SUM(CUSTO)     AS CUSTO,
***SUM (RECEITAS) +  SUM(CUSTO) + SUM(IMPOSTOVENDAS) AS 'RESULTADO OPR' ,***

calculate the average for that column OPR RESULT Thank you all.

  • 1

    Have you tried AVG(RECEITAS + CUSTO + IMPOSTOVENDAS)?

  • The average is relative to what ? The Group by ? line in sql AVG provides the average but at least for me the question was not clear.

1 answer

-1

, ('OPR'/3 RESULT) THE MEDIAOPR

Just add, the average calculation is total/factors if the average is always of the 3 factors, it is only divided by 3

Browser other questions tagged

You are not signed in. Login or sign up in order to post.