case…when…then语句,相当于编程语言中if判断
例1根据IsUser字段查询学生是否在线
select a.StudentID, (case a.IsUse
when '0' then '未在线'
when '1' then '在线' else '未上传' end) as 在线情况
from StudentBindPaperTypeEntity as
case…when…then语句,相当于编程语言中if判断
例1根据IsUser字段查询学生是否在线
select a.StudentID, (case a.IsUse
when '0' then '未在线'
when '1' then '在线' else '未上传' end) as 在线情况
from StudentBindPaperTypeEntity as