---
title: "数据库between   and的用法"
author: "liuzm"
date: "2010-01-30T09:37:41Z"
tags: []
categories: ["数据库"]
slug: "between-and"
draft: false
lastmod: "2020-06-18T16:11:15Z"
id: 583774
url: "https://liuzm.iteye.com/blog/583774"
---

今天有一个同事问我一个sql语句的问题　select * from 表 where time between　'2009-7-27' and
'2009-8-1' 他说查出来的结果没有包括　'2009-7-27' 和　'2009-8-1'　这二个时间.问我有什么办法没有
我当时第一相应就是． select * from 表 where time between　'2009-7-27　00：00：00' and
'2009-8-1　23：59：59'
我一般在处理时间问题都是这样的方法.
本篇文章来源于 :刘志猛博客 原文链接：
<http://zhimeng.com>