Fork me on GitHub
case when as将外键引用的编号用sql语句转换成能看懂的说明

例子:
select Id,FromUserId,ToUserId,[Message],RecordTime,MessageState,
case
when MessageState=1 then '就'
when MessageState=2 then '在'
when MessageState=0 then '中'
end as 状态
from message

as是将修改列名


 

posted on 2010-04-29 16:29  HackerVirus  阅读(458)  评论(0编辑  收藏  举报