Why does this query return to many counts? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

Why does this query return to many counts?

SELECT TOP (100) PERCENT DATEADD(dd, DATEDIFF(dd, 0, Date), 0) AS ALLDates, COUNT(Description) AS DeviC, COUNT(Date) AS AllC FROM dbo.AllKi GROUP BY DATEADD(dd, DATEDIFF(dd, 0, Date), 0) HAVING (COUNT(*) > 1)

18th Aug 2018, 6:44 AM
Maximilian Schmitt-Egenolf
Maximilian Schmitt-Egenolf - avatar
1 Antwort
0
Without knowing anything about the datasets or how many counts you were actually expecting, if I were to hazard a guess, it would be because you are counting everything greater than 1 with the asterisk.
18th Aug 2018, 11:11 AM
Janning⭐
Janning⭐ - avatar