0
Ich habe eine Abfrage:Distinct SUM mit Mysql Count
SELECT
t1.name as Name
count (distinct t2.key) as Total
SUM (IF(t2.time = '12:00' , 1 , 0)) as QttMidDay
FROM t1
LEFT JOIN t2 on t1.key = t2.key
GROUP BY t1.key
Die Frage ist, wie ich die "Conditional Count" zu tun auf dem 2e Parameter SUM für QttMidDay?
OT: Da Sie t1.name wählen, GROUP BY stattdessen. – jarlh
Fügen Sie einige Beispieltabellendaten und das erwartete Ergebnis hinzu - sowohl als formatierten Text. – jarlh