case when else

来源:互联网 发布:ee44ee最新域名 编辑:程序博客网 时间:2024/06/07 03:26


select *,(case when table_no>50 then 'no' else 'yes' end) as result
from member_info_mapping
where uuid <=5000 and table_no >=30

 

 使用 CASE 处理条件数据

CASE  input_expression    

WHEN when_expression

THEN result_expression         [ ...n ]    

[         ELSE else_result_expression     ]

END 
 

原创粉丝点击