Home > Database > Mysql Tutorial > body text

mysql 简单日期月份查询语句

WBOY
Release: 2016-06-07 17:51:10
Original
1098 people have browsed it

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

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

 代码如下 复制代码

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

查询当前月的数据:

 代码如下 复制代码

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

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!