Home  >  Article  >  Database  >  mysql 简单日期月份查询语句

mysql 简单日期月份查询语句

WBOY
WBOYOriginal
2016-06-07 17:51:101100browse

本文章介绍了两条sql日期操作语句,一是查询2个日期之间的数据,二是查找当月的数据,代码如下有需要的朋友看看。

查询2个日期之间的数据:

 代码如下 复制代码

SELECT * FROM `cangku` WHERE ((shijian>=’2011-1-13′) and (shijian

查询当前月的数据:

 代码如下 复制代码

* from tables where month(Date)=month(now())

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