私はこれを私に与えるmysqlにクエリを持っています
product count(*)
------- ---------
A 5
B 2
C 3
D 4
E 1
クエリは次のように単純です
select product,count(*) from dashboard group by product;
ここで問題となるのは、一部の製品の数を他の製品にマージしたいということです。たとえば、期待される出力は次のようになります。
product count(*)
------- ---------
A 7
C 3
D 5
したがって、count(A)= count(A)+ count(B)
count(c)= count(C)
count(D)= count(D)+ count(E)
こんなことを考えていた
select case
when product = 'A' OR product = 'B' then ----
when product = 'C' then ----
end