select case when TICKET_TYPE=1 then '是'
when TICKET_TYPE=2 then '不是'
when TICKET_TYPE=3 then '错误'
end as typestr
from client_exchange_ticket
本文介绍了一个使用 SQL 的 CASE WHEN 语句来转换 TICKET_TYPE 字段值的具体例子。通过该示例,读者可以了解到如何根据不同条件将数字类型的 TICKET_TYPE 转换为字符串描述。
select case when TICKET_TYPE=1 then '是'
when TICKET_TYPE=2 then '不是'
when TICKET_TYPE=3 then '错误'
end as typestr
from client_exchange_ticket
1928

被折叠的 条评论
为什么被折叠?