3
I made an Insert in a table and now I need to make a select in this table making a Count in a given column.
The point is that this column (which I gave the request name) has null value for some situations and when I do Count, I would like it to be 0 (zero) for these situations (currently it is returning 1) and for columns that have non-zero value, do Count normally.
Can someone help me, please, to set up a command for that ? Is it possible to return the information 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;
Thank you very much!! It worked!!!
– Priscila