Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
create table test(
id int, date_start datetime, date_end datetime
);
insert into test values
("1" ,"2022-01-03 12:00:00", "2022-01-03 13:20:00"),
("2" ,"2022-01-03 16:00:00", "2022-01-03 18:40:00"),
("3" ,"2022-01-04 14:00:00", "2022-01-03 14:40:00");
select exists( select 1 from test where "2022-01-03 09:00:00" between date_start and date_end);