Home > Database > Mysql Tutorial > mysql奇葩的datediff函数_MySQL

mysql奇葩的datediff函数_MySQL

WBOY
Release: 2016-05-27 14:12:36
Original
1116 people have browsed it

bitsCN.com

用过mssql的朋友应该了解datediff函数了,在mssql中,该函数的第一个参数是开始日期,第二个是结束日期,开始日期应该在结束日期之前,这样算出来的结果是大于或等于0的一个数,反之是一个负数,但在mysql中就完全相反,你若想得到一个正数结果,那第一个日期应该填结束日期,第二个参数应该填开始日期,很奇葩的设计。

/

bitsCN.com
Related labels:
source:php.cn
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