您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

选择两次mysql之间的时间

选择两次mysql之间的时间

性能方面,没有很好的方式来处理此问题。正确的where声明是:

where (start <= end and :time between start and end) or
      (end < start and :time not between end and start)

当然,您不必使用between,您可以扩展它:

where (start <= end and :time >= start and :time <= end) or
      (end < start and (:time <= end or :time >= start))
MySQL 2022/1/1 18:49:21 有249人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶