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')

后面需要转换,效率低,耗时
posted on 2021-04-15 00:54  daofree  阅读(60)  评论(0编辑  收藏  举报