3
I need to count the amount of supplies available in stock according to your codigoSuprimento
, for this I created the following sql command:
select count(codigosuprimento) quantidade, codigosuprimento from public.estoque where usado = '0' group by codigosuprimento order by codigosuprimento
But as I put it I would like him to select only those who still have at least one available (usado = '0'
) when the supply exists in stock but has none available it returns me nothing, it is possible that it returns me 0
if none is available in stock at that time?
It worked perfectly for what I needed, thank you very much +1
– R.Santos