Ich habe eine kurze Frage.Zählen doppelte Zahlen in Postgres
Ich möchte Zeilen mit gleicher Nummer zählen. Das ist, was ich bekommen:
So habe ich 4 Reihen, mit der gleichen Anzahl (59 b) und in count column
i diejenigen bekommen. Ich brauche 4
anstelle von 1
, becouse ich habe 4 Zeilen mit der gleichen Nummer.
Das ist mein sql
:
SELECT (z.miasto ||' '|| z.ulica ||' '|| z.nr_dom) as adres, (z.sym ||z.sym_ul||' '|| z.nr_dom) as symbol, zd.status, zd.id_administrator, z.uwagi,
COUNT(*) as liczba_osob
FROM zgloszenia as z
LEFT JOIN zgl_dzialamy AS zd ON (z.sym ||z.sym_ul||' '|| z.nr_dom) = (zd.sym ||zd.sym_ul||' '|| zd.nr_budynku)
WHERE status < 5
group by adres, symbol, zd.id_administrator, z.uwagi, zd.status
Kann mir jemand sagen, was mache ich falsch?