Mysql case returning type blob

Asked

Viewed 101 times

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";

inserir a descrição da imagem aqui

  • 1

    if instead of putting '0' put 0? ie without simple quotes ?

  • the problem is when it falls into Else, where it will give the higher value of the column

  • b. sequence is which type ?

  • I can’t believe I changed the quotes to do a test anyway and it worked

1 answer

0

Following the @Viirgilio Novic tip, I just removed the quotes from '0' and it worked perfectly.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.