Home  >  Article  >  Database  >  Mysql获取当前日期的前几天日期的方法_MySQL

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

WBOY
WBOYOriginal
2016-06-01 13:04:391003browse

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

代码如下:


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


输出: 2015-02-22
Statement:
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