mysql case else case_value:
case
case_value
when ...then ... else
case_value
end ...
blob
使用cast(... as ...)转换类型,如下:
select cast(case title
when 1 then 'title1'
when 2 then 'title2'
else title end
as char(20)) as 'title'
from table;
参考:
http://stackoverflow.com/questions/7830506/mysql-case-enumint-when-varchar-else-int-returning-as-blob-how-to-cast-as-a-va