1

私のアプリケーションでは、他のクエリで結合する必要がある現在の月のすべての日付を使用したいと考えています。

指定された月の日付を取得できる場合は、月番号を渡すことも問題ありません。

sqlite データベースを使用したクエリを使用してそれを行う必要があります。どんな助けでも大歓迎です。

4

2 に答える 2

2

私の以前の答えを引用するには:

SELECT date('now', 'start of month') AS Date
UNION ALL
SELECT date('now', 'start of month', '+1 days')
UNION ALL
SELECT date('now', 'start of month', '+2 days')
UNION ALL
...
UNION ALL
SELECT date('now', 'start of month', '+27 days')
UNION ALL
SELECT date('now', 'start of month', '+28 days') WHERE strftime('%m', 'now', 'start of month', '+28 days') = strftime('%m', 'now')
UNION ALL
SELECT date('now', 'start of month', '+29 days') WHERE strftime('%m', 'now', 'start of month', '+29 days') = strftime('%m', 'now')
UNION ALL
SELECT date('now', 'start of month', '+30 days') WHERE strftime('%m', 'now', 'start of month', '+30 days') = strftime('%m', 'now')
于 2013-10-21T11:59:19.007 に答える