C
cooldren
Unregistered / Unconfirmed
GUEST, unregistred user!
一个log表 一个dt字段 类型为datetime
插入数据用的
insert log (dt) values (getdate())
数据显示如下:
2007-02-06 14:34:07.790
2007-02-06 14:37:56.300
2007-02-06 14:39:01.893
2007-02-06 14:40:11.603
2007-02-07 11:32:25.463
2007-02-07 11:42:30.807
2007-02-07 11:44:00.943
2007-02-07 11:45:59.293
2007-02-08 11:46:35.197
2007-02-08 11:51:33.907
2007-02-08 11:52:29.997
2007-02-08 12:06:27.470
2007-02-09 12:07:19.397
查某天到某天的SQL语句怎么写?
select * from log where dt between '2007-02-07'and '07-02-09'
select * from log where dt>='2007-02-06' and dt<='07-02-09'
都有一天查询不到?
插入数据用的
insert log (dt) values (getdate())
数据显示如下:
2007-02-06 14:34:07.790
2007-02-06 14:37:56.300
2007-02-06 14:39:01.893
2007-02-06 14:40:11.603
2007-02-07 11:32:25.463
2007-02-07 11:42:30.807
2007-02-07 11:44:00.943
2007-02-07 11:45:59.293
2007-02-08 11:46:35.197
2007-02-08 11:51:33.907
2007-02-08 11:52:29.997
2007-02-08 12:06:27.470
2007-02-09 12:07:19.397
查某天到某天的SQL语句怎么写?
select * from log where dt between '2007-02-07'and '07-02-09'
select * from log where dt>='2007-02-06' and dt<='07-02-09'
都有一天查询不到?