在sql server 下以大于一个时间值,小于另一个时间值为查询条件,怎么写SQL查询语句

2025-01-19 03:16:54
推荐回答(2个)
回答1:

select * from orders
where orderdate betwwen '1997-01-01' and '1997-01-31'

如果要去掉边界值就用and

select * from orders
where orderdate > '1997-01-01' and orderdate < '1997-01-31'

回答2:

select * from table where date betwwen startdate and enddate