流程控制函数

 

 select *,if(socre >=85,'优秀','及格')  flag from score;

select ifnull(5,0);   //如果是5则返回5 是NULL则返回0

 

 

 

 

1.select  

   case 5

  when 1 then '你好'

  when 2 then 'hello'

  when 5 then '正确'

else  

  ‘其他’

end  info;   //输出结果 正确 info 为别名

 

 2.select  

   case 

  when 2>1 then '你好'

  when 2<1 then 'hello'

  when 3>2 then '正确'

else  

  ‘其他’

end  info;   //输出结果 你好info 为别名

 

posted @   藏进夜里躲在光下  阅读(19)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
点击右上角即可分享
微信分享提示