teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

変更

2016/07/27 23:43

投稿

A.Ichi
A.Ichi

スコア4070

answer CHANGED
@@ -1,6 +1,6 @@
1
1
  とりあえず1ヶ月は手入力で
2
2
  ```SQL
3
- select cast(c.日付 as date) 日付, count(h.開始日時) cnt
3
+ select cast(c.日付 as date) 日付, count(h.開始日時) 件数
4
4
  from 日付マスタ c left join hoge h on cast(c.日付 as date) >= cast(h.開始日時 as date) and
5
5
  (h.終了日時 is null or cast(c.日付 as date) <= h.終了日時)
6
6
  where c.日付 between '2016-04-01' and '2016-04-06'