SQLite SELECT特定月份的日期 [英] SQLite SELECT date for a specific month

查看:105
本文介绍了SQLite SELECT特定月份的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前使用过Microsoft的Jet数据库引擎。而且,如果我需要选择特定月份的条目,我可以这样做:

  SELECT * FROM`table name` WHERE MONTH(`date column`)= 4 

但是,你如何使用SQLite? p>

解决方案

如何

  SELECT * FROM table_name WHERE strftime('%m',date_column)='04'

日期和时间函数


I was using Microsoft's Jet database engine before. And, say, if I needed to select entries for a specific month I do this:

SELECT * FROM `table name` WHERE MONTH(`date column`)=4

But how do you do the same with SQLite?

解决方案

How about

SELECT * FROM table_name WHERE strftime('%m', date_column) = '04'

Date And Time Functions

这篇关于SQLite SELECT特定月份的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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