SQL查询结果如何通过语句转换为显示值

有如下键值对:
WH=WuHan
SZ=ShenZhen
BJ=BeiJing

数据库查询结果集返回的是Key值 如WH、SZ、BJ
如何在结果集中转换为显示值,如WuHan、ShenZhen
这个键值对没有在数据库中保存,键值对数量也有限,能否在查询时根据结果集转换下,谢谢

前提是:数据库不能建表保存该键值对

case key_field
when 'WH' then 'WuHan'
when 'SZ' then 'ShenZhen'

when 'BJ' then 'BeiJing'

.....
else '' end

  • select CASE key_name
  • when 'WH' then 'WuHan' else
  • when 'SZ' then 'ShenZhen' else
  • when 'BJ' then 'BeiJing' else 'other'
  • end
  • end
  • end_

select CASE key_name
when 'WH' then 'WuHan' else
when 'SZ' then 'ShenZhen' else
when 'BJ' then 'BeiJing' else 'other'
end
end
end
from table_nm

使用临时表,先将键值对数据插入,然后比较查询