if(condition, a, b)
select sum(if(user_id>0, 1, 0)) as reigistered_count from order
case when condition then [A] else [B] end
select case grade>9 then ‘初中‘ else ‘小学‘ end as grade from student
2022-05-29 08:55:03
select sum(if(user_id>0, 1, 0)) as reigistered_count from order
select case grade>9 then ‘初中‘ else ‘小学‘ end as grade from student