Everything useful before you download or buy.
Dates that group, subtract, add up and compare the way you meant, in four databases.
Two A4 pages on dates in SQL, worked on HealSync's tables from Explain Your Query: claims, telemedicine sessions and research studies. Every query was run in DuckDB, and its real result is printed under it.
It covers literals and casts, the parts of a date (including ISO weeks, where 1 January 2023 belongs to 2022), periods with date_trunc, month labels that sort as text, differences in days and in months, adding months at month ends, and a month series that drifts to the 28th. Then calendars built with generate_series and range to find the months and days with nothing in them, gaps between events including the one still open on the as-of date, what was running as of each quarter end, timestamps on the last day of a range, and text that must be parsed into a date.
It ends with a table of the same moves in DuckDB, PostgreSQL, SQL Server and MySQL, listing only documented equivalents.
PDF to print, and an HTML version to read on screen.
Check the resource before buying — a limited-page preview.
This is a limited-page preview. If it does not load, open the PDF directly.
One review per person. Submitting again updates your existing review.
Be the first to review this resource.