用case when 条件 then xxx
when..............then
when..............then
end
eg:
select t.taxpayerid,
case
when t.taxpayerver = '1' then
'dddd'
when t.taxpayerver = '3' then
'kkkk'
end,
t.*
from tb_reg_taxpayerbasicinfo t
when..............then
when..............then
end
eg:
select t.taxpayerid,
case
when t.taxpayerver = '1' then
'dddd'
when t.taxpayerver = '3' then
'kkkk'
end,
t.*
from tb_reg_taxpayerbasicinfo t
本文介绍了一个使用 SQL 中 CASE WHEN 语句的具体例子,展示了如何根据不同的条件返回特定的值。通过一个税务基本信息表的查询案例,演示了 CASE WHEN 在实际场景中的应用。
436

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



