SELECt * FROM ( SELECt birthday , month(current_date() ) nowmonth ,month(date_add(current_date(),5)) nextmonth ,month(to_date(birthday)) usermonth , day(current_date() ) nowday ,day(date_add(current_date(),5)) nextday , day(to_date(birthday)) userday from tablename ) WHERe ( nowmonth != nextmonth AND ( (nowmonth== usermonth AND userday> nowday ) or (nextmonth == usermonth AND userday <= nextday ) ) ) OR (nowmonth == nextmonth AND userday > nowday AND userday <=nextday ) ;
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)