Add amount units of time to a date/timestamp expression.
See dialect notes on dateTrunc / module doc for the general
per-dialect divergence rationale; per-function notes:
postgres/cockroachdb: expr + INTERVAL 'n unit'.
redshift: DATEADD(unit, n, expr) (SQL-Server-style function, NOT interval
arithmetic, despite being Postgres-derived).
mysql/mariadb: DATE_ADD(expr, INTERVAL n UNIT).
mssql/snowflake: DATEADD(unit, n, expr).
oracle: day-level uses plain +/- arithmetic (Oracle DATE math is in
days); month/year use ADD_MONTHS; hour/minute/second are expressed as
fractional-day arithmetic.
sqlite: datetime(expr, '+n units').
db2: labeled-duration arithmetic, e.g. expr + n DAYS.
Add
amountunits of time to a date/timestamp expression. See dialect notes on dateTrunc / module doc for the general per-dialect divergence rationale; per-function notes:expr + INTERVAL 'n unit'.DATEADD(unit, n, expr)(SQL-Server-style function, NOT interval arithmetic, despite being Postgres-derived).DATE_ADD(expr, INTERVAL n UNIT).DATEADD(unit, n, expr).+/-arithmetic (Oracle DATE math is in days); month/year useADD_MONTHS; hour/minute/second are expressed as fractional-day arithmetic.datetime(expr, '+n units').expr + n DAYS.expr + INTERVAL n UNIT.