Average Cost SQL

0

Hello. I need to present the average cost, the lowest cost and the highest cost of all products and still present the total of products checked. The table I have is this:

Does anyone know how I generate this?

    
asked by anonymous 09.10.2018 / 02:45

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
    
09.10.2018 / 03:04