Cheat Sheet BUY NOW Intermediate Preview available

Dates in SQL

by LucidPlexus
0.00 · 0 reviews
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,…
2 Pages
0 Views
0 Downloads

Overview

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.

Type Cheat Sheet
Pages 2
Access Buy Now

Preview

Check the resource before buying — a limited-page preview.

Open PDF
Loading preview…

This is a limited-page preview. If it does not load, open the PDF directly.

Ratings & Reviews

One review per person. Submitting again updates your existing review.

0 total

Write a review

Share what helped, what stood out, or who this resource is best for.

No reviews yet

Be the first to review this resource.

Login to Buy Preview