节气查询sql
查询当前节气是否在最近的节气的两天内
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
还没有评论,来说两句吧...