Home  >  Article  >  Database  >  Why are numbers in the MySQL INTERVAL() function best written in ascending order?

Why are numbers in the MySQL INTERVAL() function best written in ascending order?

WBOY
WBOYforward
2023-08-27 08:25:101322browse

为什么 MySQL INTERVAL() 函数中的数字最好按升序写入?

Actually, the INTERVAL() function uses a binary search to search for a number greater than the number of the first argument. So, that's why if we want the INTERVAL() function to work efficiently, the list of numbers will be in ascending order. Here is a good way to use the INTERVAL() function -

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

The above is the detailed content of Why are numbers in the MySQL INTERVAL() function best written in ascending order?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete