concat(year(broadcast_time), '-', case when weekofyear(broadcast_time)<10 then concat(0,weekofyear(broadcast_time)) else weekofyear(broadcast_time) end ) >=
concat( year(date_sub(to_date(from_unixtime(unix_timestamp())),112)), '-', case when weekofyear(date_sub(to_date(from_unixtime(unix_timestamp())),112))<10 then concat(0,weekofyear(date_sub(to_date(from_unixtime(unix_timestamp())),112))) else weekofyear(date_sub(to_date(from_unixtime(unix_timestamp())),112)) end )
1条答案
按热度按时间j2datikz1#
这是我的一个建议,似乎很管用。为了正确比较字符串,我在小于10的周数上加0