I need to count the amount of supplies available in stock according to your codigoSuprimento
, so 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 it to select only those that still have at least one available ( usado = '0'
) when the supply exists in the stock but has none available it does not return anything to me, it is possible that it returns me 0
if there are none available in stock at that time?