SQL case语句

修改从数据库搜索出来的数据的值。



表:


1、使用普通SQL语句:

 select patientid,plusid from test


结果为:



2、修改搜索出来数据的值

SQL语句:

select patientid,(case plusid when'202' then '202备注' when '203' then '203备注' when'207' then '207备注' else '' end)exples
from test


结果为:



猜你喜欢

转载自blog.csdn.net/jos1n/article/details/78245468
今日推荐