Mysql date comparison statement bitsCN.com
Mysql date comparison statement select * from student where '2017-02-27 00:00:00 '<created_date and '2017-02-29 00:00:00'> created_date select * from student where UNIX_TIMESTAMP ('2017-2012- 02-27 00:00:00 ') <UNIX_TIMESTAMP (created_date) and UNIX_TIMESTAMP ('2017-02-29 00:00:00 ')> UNIX_TIMESTAMP (created_date); SELECT * FROM student WHERE (UNIX_TIMESTAMP (created_date) -UNIX_TIMESTAMP ('2017-02-26 00:00:00 ')> = 0 AND (UN IX_TIMESTAMP (created_date)-UNIX_TIMESTAMP ('2017-02-29 00:00:00 ') <= 0 the unix_timestamp function of MySql can accept a parameter or use no parameter. The return value is an unsigned integer. If the parameter is not used, it returns the number of seconds that have elapsed since 00:00:00, January 1, January 1, 1970. if the parameter is used, the parameter type is time or time string representation, it is the number of seconds that have elapsed since 00:00:00 to the specified time.
With this function, you can naturally convert the time comparison into a comparison of unsigned integers. For example, determine whether a time is in a single interval unix_timestamp (time) between unix_timestamp ('start') and unix_timestamp ('end') bitsCN.com
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service