开发者

SQLite: get day

开发者 https://www.devze.com 2023-02-19 16:02 出处:网络
How can I return the day of a DateTime in SQLite? I have my field Date st开发者_如何转开发ored as a DateTime.

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

精彩评论

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