Syntax
------ 
INTERVAL(N,N1,N2,N3,...)
 
Description
----------- 
Returns the index of the last argument that is less than the
first argument or is NULL. 
 
Returns 0 if N < N1, 1 if N < N2, 2 if N < N3 and so on or
-1 if N is NULL. All
arguments are treated as integers. It is required that N1 <
N2 < N3 

URL: https://mariadb.com/kb/en/interval/