SQLite SELECT date for a specific month

2019-01-23 16:36发布

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?

2条回答
对你真心纯属浪费
2楼-- · 2019-01-23 16:56
SELECT * FROM `table name` WHERE strftime('%m', `date column`) = '04'

sqlite date&time functions

查看更多
你好瞎i
3楼-- · 2019-01-23 17:06

How about

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

Date And Time Functions

查看更多
登录 后发表回答