查詢當前節氣是否在最近的節氣的兩天內
1.節氣對照表;
2.sql
select count(*) as total from( SELECT * FROM tzbs2.solarterm where to_days(date) >= to_days('2020-01-07 16:56:06')-1 LIMIT 1 )tmp where to_days(date) - to_days('2020-01-06 16:56:06') < 2
and to_days('2020-01-08 16:56:06') - to_days(date) >= 0