回答編集履歴

3

変更

2017/04/27 00:59

投稿

A.Ichi
A.Ichi

スコア4070

test CHANGED
@@ -30,12 +30,10 @@
30
30
 
31
31
  where sum_year between to_char('2014-04-01'::date,'YYYY')::numeric and to_char((date '2014-04-01' +interval '3 month'),'YYYY')::numeric
32
32
 
33
- and not (sum_year = to_char('2014-04-01'::date,'YYYY')::numeric and sum_monthly > 1 and sum_monthly < substr('2014-04-01',6,2)::numeric)
33
+ and not (sum_year = to_char('2014-04-01'::date,'YYYY')::numeric and sum_monthly < substr('2014-04-01',6,2)::numeric)
34
34
 
35
- and not (sum_year = to_char((date '2014-04-01' +interval '3 month'),'YYYY')::numeric
35
+ and not (sum_year = to_char((date '2014-04-01' +interval '3 month'),'YYYY')::numeric and sum_monthly >= to_char((date '2014-04-01' +interval '3 month'),'mm')::numeric)
36
36
 
37
- and sum_monthly < 12 and sum_monthly >= to_char((date '2014-04-01' +interval '3 month'),'mm')::numeric)
38
-
39
- and sum_day = substr('2014-04-01',9,2)::numeric;
37
+ and sum_day = substr('2014-04-01',9,2)::numeric;
40
38
 
41
39
  ```

2

変更

2017/04/27 00:59

投稿

A.Ichi
A.Ichi

スコア4070

test CHANGED
@@ -30,12 +30,12 @@
30
30
 
31
31
  where sum_year between to_char('2014-04-01'::date,'YYYY')::numeric and to_char((date '2014-04-01' +interval '3 month'),'YYYY')::numeric
32
32
 
33
- and sum_monthly between substr('2014-04-01',6,2)::numeric and 12
33
+ and not (sum_year = to_char('2014-04-01'::date,'YYYY')::numeric and sum_monthly > 1 and sum_monthly < substr('2014-04-01',6,2)::numeric)
34
34
 
35
+ and not (sum_year = to_char((date '2014-04-01' +interval '3 month'),'YYYY')::numeric
36
+
35
- and sum_monthly >= 1 and sum_monthly < to_char((date '2014-04-01' +interval '3 month'),'mm')::numeric
37
+ and sum_monthly < 12 and sum_monthly >= to_char((date '2014-04-01' +interval '3 month'),'mm')::numeric)
36
38
 
37
39
  and sum_day = substr('2014-04-01',9,2)::numeric;
38
40
 
39
-
40
-
41
41
  ```

1

変更

2017/04/27 00:54

投稿

A.Ichi
A.Ichi

スコア4070

test CHANGED
@@ -32,7 +32,7 @@
32
32
 
33
33
  and sum_monthly between substr('2014-04-01',6,2)::numeric and 12
34
34
 
35
- and sum_monthly > 1 and sum_monthly < to_char((date '2014-04-01' +interval '3 month'),'mm')::numeric
35
+ and sum_monthly >= 1 and sum_monthly < to_char((date '2014-04-01' +interval '3 month'),'mm')::numeric
36
36
 
37
37
  and sum_day = substr('2014-04-01',9,2)::numeric;
38
38