I made an insert into a table and now I need to make a select in that table by making a count in a given column.
The question is that this column (which I gave the request name) has null value for some situations and when I do the count, I would like to indicate 0 (zero) for these situations (currently it is returning 1) and for the columns which has nonzero value, count as usual.
Can someone please help me set up a command for this? is it possible to return the information in this way?
select 0,
a.seqpessoa,
a.nomerazao,
a.cidade,
a.uf,
a.bairro,
a.fone,
a.dtaultfat,
a.datref,
a.equipe,
count (a.pedido) as pedido
from PAS_CLI_CAD_EQUIPE_PEDIDO a
group by a.seqpessoa,
a.nomerazao,
a.cidade,
a.uf,
a.bairro,
a.fone,
a.dtaultfat,
a.datref,
a.equipe;