Home > Database > Mysql Tutorial > body text

Mysql获取当前日期的前几天日期的方法_MySQL

WBOY
Release: 2016-06-01 13:04:39
Original
1004 people have browsed it

如:获得 2015-03-01 日的前7天的日期 :

代码如下:


select date_sub('2015-03-01',interval 7 day) from rs_pay_data;


输出: 2015-02-22
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!