O'Reilly logo

Joe Celko's Thinking in Sets: Auxiliary, Temporal, and Virtual Tables in SQL by Joe Celko

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9.2. The ISO Half-Open Interval Model

The display formats for temporal data are defined by the ISO-8601 Standard. The display formats are important, of course, but even more important is the underlying model of durations. They are considered to be half-open intervals. That means that we have an exact point in time when an event starts, but we can only approach the end of it as a limit. To make that clearer, consider the date 2006-12-31 as a shorthand for the interval (2006-12-31 00:00:00 through 2006-12-31 23:59:59.999...). There is no such time as “2006-12-31 24:00:00” in this model; technically, the hour does not exist, and you meant to say “2007:01-01 00:00:00” instead.

DB2 and other SQL products allow a timestamp whose time part is 24:00:00.000000. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required