Home > Database > Mysql Tutorial > 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
Release: 2023-08-27 08:25:10
forward
1375 people have browsed it

为什么 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);
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template