获取当月记录 [英] Get records of current month

查看:75
本文介绍了获取当月记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从MySql数据库表中选择当前月"记录?

How can I select Current Month records from a table of MySql database??

就像现在的本月是一月.我想获取一月月份的记录,其中我的表列的数据类型为timestamp.我想知道sql查询.

Like now current month is January. I would like to get records of January Month, Where data type of my table column is timestamp.I would like to know the sql query.

谢谢

推荐答案

此查询应为您工作:

SELECT *
FROM table
WHERE MONTH(columnName) = MONTH(CURRENT_DATE())
AND YEAR(columnName) = YEAR(CURRENT_DATE())

这篇关于获取当月记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆