首页 > 数据库技术 > 详细

mysql中select 值复杂逻辑处理

时间:2021-09-12 10:10:05      阅读:38      评论:0      收藏:0      [点我收藏+]
 Select  (Case when replace(date_format(create_time, %m), 0, ‘‘) in (1,2,3) then 一季度
                     when  replace(date_format(create_time, %m), 0, ‘‘) in (4,5,6) then 二季度
                     when  replace(date_format(create_time, %m), 0, ‘‘) in (7,8,9) then 三季度
                     when  replace(date_format(create_time, %m), 0, ‘‘) in (10,11,12) then 四季度 end )as a
from t_business_opportunity

 

mysql中select 值复杂逻辑处理

原文:https://www.cnblogs.com/ff2ting/p/15247196.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!