在SQL Server 2000和2005中:
- 这两个
WHERE
子句有什么区别? - 我应该在哪种情况下使用哪一个?
查询1:
SELECT EventId, EventName
FROM EventMaster
WHERE EventDate BETWEEN '10/15/2009' AND '10/18/2009'
查询2:
SELECT EventId, EventName
FROM EventMaster
WHERE EventDate >='10/15/2009'
AND EventDate <='10/18/2009'
(编辑:最初缺少第二个Eventdate,因此查询在语法上是错误的)