Support the ongoing development of Laravel.io →
posted 7 years ago
Database
Last updated 2 years ago.
0

problem solved:

select aux.Rede , aux.PDV , aux.RUPTURA , (aux.RUPTURA/aux.PDV)*100 as Percentual from (SELECT rede , CAST(COUNT( case when pdv is not null AND sku ='40KU6000' AND semana = 'W28'then 1 end) as FLOAT) PDV , CAST(COUNT( case when produto_em_ruptura='SIM' AND sku ='40KU6000' AND semana = 'W28' then 1 end) AS FLOAT) RUPTURA FROM dbm.controle_ruptura GROUP BY rede) aux WHERE aux.PDV <> 0 order by 4 desc;

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Anderson Anderson aosantos Joined 20 Jul 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.