top
1
*
from
demotab
where
(
‘
“&start_time&”
‘
<=
start_time
and
‘
“&end_time&”
‘
>=
end_time)
or
—
判断新日期段与原日期段是否存在外包含
(
‘
“&start_time&”
‘
>=
start_time
and
‘
“&end_time&”
‘
<=
end_time)
or
—
判断新日期段与原日期段是否存在内包含
(
‘
“&start_time&”
‘
<=
start_time
and
‘
“&end_time&”
‘
<=
end_time
and
‘
“&end_time&”
‘
>=
start_time)
or
—
判断新日期段与原日期段是否存在左交叉
(
‘
“&start_time&”
‘
>=
start_time
and
‘
“&start_time&”
‘
<=
end_time
and
‘
“&end_time&”
‘
>=
end_time)
—
判断新日期段与原日期段是否存在右交叉
如果SQL语句有返回记录则日期有冲突,否则则正确!
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/110489.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...