sql性能优化

# and OCCURTIME >= '2021-04-15 01:00:00'
# and OCCURTIME < '2021-04-15 23:59:59'
and str_to_date(OCCURTIME, 'yyyy-mm-dd hh24:mi:ss') >= str_to_date('2021-04-15 01:00:00', 'yyyy-mm-dd hh24:mi:ss')
and str_to_date(OCCURTIME, 'yyyy-mm-dd hh24:mi:ss') < str_to_date('2021-04-15 23:00:00', 'yyyy-mm-dd hh24:mi:ss')

后面需要转换,效率低,耗时
原文地址:https://www.cnblogs.com/daofree/p/14660711.html