INTERVAL()

Overview

Returns the index of the last argument that is less than the first argument or is NULL.

USAGE

INTERVAL(find, number[, number] ...)

Argument Name

Description

find

The number that is being compared against the list

number

One or more numeric arguments that are compared against find

DETAILS

INTERVAL() is a comparison function that returns the index of the last argument whose value is less than the first argument.

A -1 is returned if the first argument is NULL.

INTERVAL() requires arguments to be integers, and for non integer arguments generates a Warning : "Truncated incorrect DOUBLE value".

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT INTERVAL(1, 2, 4, 6, 8) AS result1,
       INTERVAL(4, 2, 4, 6, 8) AS result2,
       INTERVAL(9, 2, 4, 6, 8) AS result3;
+---------+---------+---------+
| result1 | result2 | result3 |
+---------+---------+---------+
|       0 |       2 |       4 |
+---------+---------+---------+
SELECT INTERVAL(NULL, 2, 4, 6, 8) AS result;
+--------+
| result |
+--------+
|     -1 |
+--------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES