SELECT IF(DATE_FORMAT(start_time,'%Y-%m-%d')<=DATE_FORMAT(NOW(),'%Y-%m-%d') and DATE_FORMAT(NOW(),'%Y-%m-%d')<=DATE_FORMAT(end_time,'%Y-%m-%d'),'01','02') aFROM `t_activity`;
本文共 237 字,大约阅读时间需要 1 分钟。
SELECT IF(DATE_FORMAT(start_time,'%Y-%m-%d')<=DATE_FORMAT(NOW(),'%Y-%m-%d') and DATE_FORMAT(NOW(),'%Y-%m-%d')<=DATE_FORMAT(end_time,'%Y-%m-%d'),'01','02') aFROM `t_activity`;
转载于:https://www.cnblogs.com/save-shengfei/p/6728521.html