Problem Statement
Which predicate keeps a datetime column SARGable for a single day filter?
Explanation
Filtering the raw column with a range allows an index seek. Wrapping the column in a function blocks index use in many engines and forces scans.
A half-open range (greater-than-or-equal to start and less than next day) is even safer across time types and precision.
Code Solution
SolutionRead Only
WHERE created_at >= '2025-10-01' AND created_at < '2025-10-02'
Practice Sets
This question appears in the following practice sets:
