SQLServer(二) Case When

案例一

select 
id,
case id 
when ‘6‘ then ‘six‘
when ‘7‘ then ‘seven‘
when ‘8‘ then ‘eight‘
else ‘other‘
end as id_type
from formtable_main_122 where id = 7

相关推荐