select Id ,
case when Id=1 then '等于1'
when Id >=60 then '大于60' --注意各结果的数据类型须一致,int和时间等不能转为字符串没出错
when Id <60 then '小于60'
else 'ok' end
AS result ,
OwnId
from ContentDetectionRecord
SQL语句 CASE WHEN的用法
最新推荐文章于 2025-06-23 16:07:14 发布
select Id ,
case when Id=1 then '等于1'
when Id >=60 then '大于60' --注意各结果的数据类型须一致,int和时间等不能转为字符串没出错
when Id <60 then '小于60'
else 'ok' end
AS result ,
OwnId
from ContentDetectionRecord