神之墓地第三季0.7:sql 日期型数据模糊查找

来源:百度文库 编辑:神马品牌网 时间:2024/04/28 07:03:58
比如说2006-8-15,如何能查找出2006-8的所有数据来?

select * from 表 where date between(2006-8-1, 2006-8-31)

将输入的字符用相应数据库的函数转化为日期格式

select * from 表 where date between '2006-8-1' and '2006-8-31'

select * from 表 where 字段>= '&2006-8-1&' and 字段<='2006-8-31'

select * from 表 where date between '2006-8-1' and '2006-8-31'

两种方法一样的