相关疑难解决方法(0)

检索日期范围的最有效方法

使用这样的表结构检索日期范围的最有效方法是什么?

create table SomeDateTable
(
    id int identity(1, 1) not null,
    StartDate datetime not null,
    EndDate datetime not null
)
go
Run Code Online (Sandbox Code Playgroud)

假设你想要既范围StartDateEndDate。因此,换句话说,如果StartDate介于@StartDateBeginand之间@StartDateEnd,并且EndDate介于@EndDateBeginand之间@EndDateEnd,则执行某些操作。

我知道有几种方法可以解决这个问题,但最建议的是什么?

performance sql-server query-performance

18
推荐指数
2
解决办法
3万
查看次数