mysql case when使用

2024-10-09 08:34:56 浏览数 (3)

## mysql case when使用

SELECT order_no, case is_test when 0 then '否' when 1 then '是' end as '是否测试' from `tbl_order` WHERE `order_no` in ( 'afsd122112121' );

SELECT order_no, case is_test when 0 then '否' else '是' end as '是否测试' from `tbl_order` WHERE `order_no` in ( 'afsd122112121' );

SELECT order_no, case WHEN is_test = 0 then '否' else '是' end as '是否测试' from `tbl_order` WHERE `order_no` in ( 'afsd122112121' );

0 人点赞