Home > Database > Mysql Tutorial > body text

mysql两日期之间数据查询语句

WBOY
Release: 2016-06-07 17:51:12
Original
1122 people have browsed it

本文章简单的介绍了关于在mysql数据库中如何来实现查询2个日期之间的数据,下面我们来看实例。

 代码如下 复制代码

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

查询当前月的数据:

 代码如下 复制代码

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

很简单吧,第一种还可以利用between来实现,这里我也不说了自己测试吧。

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!