回答編集履歴

2

訂正

2019/08/23 02:48

投稿

sazi
sazi

スコア25300

test CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  select id, period
6
6
 
7
- , (select sum(value) from value_table
7
+ , (select sum(cast(value as integer)) from value_table
8
8
 
9
9
  where id=t.id
10
10
 

1

訂正

2019/08/23 02:48

投稿

sazi
sazi

スコア25300

test CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  where id=t.id
10
10
 
11
- and period between t.period and to_char(dateadd(RM, 1, to_date(t.period, 'YYYYMM')), 'YYYYMM')
11
+ and period between t.period and to_char(dateadd(RM, 2, to_date(t.period, 'YYYYMM')), 'YYYYMM')
12
12
 
13
13
  ) as value
14
14