mysql中select 值复杂逻辑处理

 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

 

上一篇:MERGE 更新和插入合并


下一篇:[SQL] CASE...WHEN 进行排序和分组