回答編集履歴
2
ちょうせい
test
CHANGED
@@ -34,6 +34,8 @@
|
|
34
34
|
|
35
35
|
,sum(price*(area_id=3)) as osaka
|
36
36
|
|
37
|
+
,sum(price*(area_id=4)) as kyoto
|
38
|
+
|
37
39
|
,sum(price) as `all`
|
38
40
|
|
39
41
|
from tbl
|
1
追記
test
CHANGED
@@ -26,8 +26,6 @@
|
|
26
26
|
|
27
27
|
|
28
28
|
|
29
|
-
|
30
|
-
|
31
29
|
select pay_date
|
32
30
|
|
33
31
|
,sum(price*(area_id=1)) as tokyo
|
@@ -36,8 +34,14 @@
|
|
36
34
|
|
37
35
|
,sum(price*(area_id=3)) as osaka
|
38
36
|
|
37
|
+
,sum(price) as `all`
|
38
|
+
|
39
39
|
from tbl
|
40
40
|
|
41
41
|
group by pay_date
|
42
42
|
|
43
|
+
|
44
|
+
|
43
45
|
```
|
46
|
+
|
47
|
+
※横の計がぬけてたので追記しました
|