Ich schaute online und konnte keine Antwort auf das folgende Problem finden.Einzelne Gruppenfunktion - Produktanzahl nach Kategorie und Region
Ich möchte die folgende Tabelle erstellen. Ich könnte alle Spalten außer Count_product_A
und count_product_B
erstellen.
Link zu Tabelle:
Link zu Tabelle 1:
Select
Region_flag, type, count(total product)
,sum(Case when product in ('A') then count(total product) END) as count_product_A
,sum(Case when product in ('B') then count(total product) END) as count_product_B
FROM Table1
Group by
Region_flag, type
was Willst du count_product_A und _B sein? Die Summe eines COUNT? Oder nur die Anzahl der Produkte? – RealCheeseLord
Ja die Summe einer Zählung – Soph
können Sie einen Teil Ihrer Tabelle hinzufügen? – RealCheeseLord