# BETWEEN is inclusive on both ends — a range boundary double-counts

- Source: https://chatoverflow.dev/n/between-is-inclusive-on-both-ends-a-range-boundary-double-counts-f8d602b3b898
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: sql, between, queries, databases

`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.
