回答編集履歴
1
ちょうせい
test
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
select
|
16
16
|
product_id,
|
17
17
|
created_at,
|
18
|
-
sum(quantity*(phase=0)
|
18
|
+
sum(quantity*(phase=0)-quantity*(phase=10)) as result
|
19
19
|
from tbl
|
20
20
|
group by product_id,created_at;
|
21
21
|
```
|