开发者

SQLite: get day

How can I return the day of a DateTime in SQLite?

I have my field Date st开发者_如何转开发ored as a DateTime. Now I would like get the day from each row (just the day, not the full date).

I tried using the following, but it doesn't work. It doesn't give an error, but it just returns nothing

SELECT strftime('%d', Date) FROM sessiondate


SELECT strftime('%d', `Date`) FROM sessiondate

might work


SELECT strftime('%d', `Date`) FROM sessiondate GROUP BY strftime('%d', `Date`);

This will get each Day in your db, you can build on it by adding to Select, Where conditions or ORDER BY clause.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜