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
| Parameter | Type | Required | Description |
|---|---|---|---|
row | ROW | Yes | Named 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 |
On this page