sql语句判断两个时间段是否有交集
SQL脚本
CREATE TABLE [dbo].[test](
[Id] [uniqueidentifier] NOT NULL,
[name] [nvarchar](50) NULL,
[StartTime] [datetime] NULL,
[EndTime] [datetime] NULL,
CONSTRAINT [PK_test] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
insert into
共有 0 条评论