A Gentle Introduction to

SQL

DATES

How to work with dates; adding, subtracting and formatting.


Subtract dates
Many implementations allow dates to be treated as numbers. We can add a number of days to a date.
Dates are often stored as the number of days since a fixed time.
We want to know how long has it been since Tom Jones featured on TOTP.
oracle variations:
None

access
db2
mysql
oracle
postgres
sqlserver