回答編集履歴

1

ちょうせい

2022/12/01 01:28

投稿

yambejp
yambejp

スコア114839

test CHANGED
@@ -15,7 +15,7 @@
15
15
  select
16
16
  product_id,
17
17
  created_at,
18
- sum(quantity*(phase=0)+quantity*-(phase=10)) as result
18
+ sum(quantity*(phase=0)-quantity*(phase=10)) as result
19
19
  from tbl
20
20
  group by product_id,created_at;
21
21
  ```