把日期两边的单引号去掉.
飘过~~
select * from Sales where ord_date between '1993-01-01' and '1994-01-01' order by title_id desc
select * from sales where ord_date > '1993-01-01' and '1994-01-01' order by title_id desc 这两种都比我那种好,如果在ord_date建索引的话这两种方法都能使用索引,而我那种却会导致全表扫描
第二种方法我试了,不对啊.
应该是:
select * from sales where ord_date > '1993-01-01' and ord_date<'1994-01-01' order by title_id desc
[此贴子已经被作者于2007-4-3 9:22:00编辑过]