mysql中select 值复杂逻辑处理

时间:2021-09-12 10:10:05   收藏:0   阅读:40
 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

 

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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!