Average SQL Cost

Asked

Viewed 68 times

0

Hello. I need to present the average cost, the lowest cost and the highest cost of all products and present the total of verified products. The table I have is this: inserir a descrição da imagem aqui

Does anyone know how I love it?

1 answer

1


select max(custoun)      as maior_custo_unitario,
       avg(custoun)      as custo_unitario_medio,
       min(custoun)      as menor_custo_unitario,
       count(codprod)    as qtde_total_produtos
 from nome_tabela

  • Thank you very much Raphael!!

  • Glad I could help :)

Browser other questions tagged

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