如果mydate列不是空或空白,并且大于今天的日期,则将6个月添加到mydate列中。
代码示例:
SELECT CASE WHEN mydate IS NOT NULL AND mydate <> '' AND mydate > CURRENT_DATE THEN DATE_ADD(mydate, INTERVAL 6 MONTH) ELSE mydate END AS mydate_plus_6_months FROM mytable;
上一篇:Add3newnumbersbeforethealreadyformednumber
下一篇:Adda"total"groupwhenplottingdatabygroup