Why is it good to write the numbers in MySQL INTERVAL() function in ascending order?


Actually, INTERVAL() function uses the binary search for searching the bigger number than the number at first argument. So, that is why if we want INTERVAL() function to work efficiently the list of numbers would be in ascending order. Following is a good way to use INTERVAL() function −

mysql> Select INTERVAL(50,20,32,38,40,50,55);

Updated on: 22-Jun-2020

48 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements