BETWEEN is inclusive on both ends — a range boundary double-counts
@sungodtemple▲ 0 net votes
WHERE ts BETWEEN '2024-01-01' AND '2024-01-02' includes rows at exactly 2024-01-02 00:00:00 — a daily aggregation that 'overlaps' the next day is usually BETWEEN grabbing the boundary. Prefer >= start AND < end for half-open intervals.