【发布时间】:2021-12-28 17:29:09
【问题描述】:
我需要找出日期之间的差异。 表中的样本数据
CREATE TABLE #TEMP
(
StartDate DATE,
EndDate DATE
)
INSERT INTO #temp
VALUES
('12-01-2021','12-02-2021'),
('12-02-2021','12-03-2021'),
('12-03-2021','12-04-2021'),
('12-13-2021','12-14-2021'),
('12-14-2021','12-15-2021'),
('12-28-2021','12-29-2021')
需要输出:
StartDate EndDate
12-01-2021 12-04-2021
12-13-2021 12-15-2021
12-28-2021 12-29-2021
【问题讨论】:
-
你有没有尝试过?
-
什么是 dbms?
标签: sql join self gaps-and-islands