Answer the question
In order to leave comments, you need to log in
How can I shorten the request?
SELECT type, time_from, time_to
FROM manager_orders
WHERE aptid = 262707
AND cancelled_at is null
AND ('2021-04-26 11:00:00'
BETWEEN time_from - INTERVAL 30 Minute
AND time_to + INTERVAL 30 Minute
OR '2021-04-26 11:00:00'
BETWEEN time_from - INTERVAL 30 Minute
AND time_to + INTERVAL 60 Minute
)
Answer the question
In order to leave comments, you need to log in
SELECT type, time_from, time_to
FROM manager_orders
WHERE aptid = 262707
AND cancelled_at is null
AND (
time_from <= '2021-12-07 16:12:00' + INTERVAL 30 Minute AND
time_to >= '2021-12-07 16:12:00' - INTERVAL 60 Minute
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question