MAKE_INTERVAL()

All functions > DATE AND TIME > MAKE_INTERVAL()

Builds an INTERVAL from a ROW of duration components.

Signatures

Returns: The constructed INTERVAL

MAKE_INTERVAL(row: ROW) → INTERVAL
sql
ParameterTypeRequiredDescription
rowROWYesNamed fields: years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds

Notes

  • The ROW must expose exactly these names (case-insensitive): years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds.
  • Omit unused units with zero or NULL in the ROW expression as needed.
  • Components are combined on the SQL side into a single INTERVAL value.

Examples

FeatureQL
SELECT
    f1 := MAKE_INTERVAL(ROW(1 AS years, 0 AS months, 0 AS weeks, 2 AS days, 3 AS hours, 0 AS minutes, 0 AS seconds, 0 AS milliseconds, 0 AS microseconds)) -- Construct an INTERVAL from parts
;
Result
f1 VARCHAR
362 days 03:00:00

Last update at: 2026/05/26 17:22:09