1
I created a search query in Mysql and using case
within it.
The problem is that by returning the value of the column that is of the whole type, the value comes with the answer blob
.
Follow SELECT with image of the query result below:
select
max(b.sequencia),
case
when b.sequencia is null then '0'
else max(b.sequencia)
end as Max
from
cad_tramitacao b
where
b.ficha = '187080' and b.arquivo = 'M' and b.incidente = "0";
if instead of putting '0' put 0? ie without simple quotes ?
– novic
the problem is when it falls into Else, where it will give the higher value of the column
– Luiz Gustavo Costa Ceolin
b. sequence is which type ?
– novic
I can’t believe I changed the quotes to do a test anyway and it worked
– Luiz Gustavo Costa Ceolin