You have to put another Archived in the outer query.This is becacuse same cost center can be both archive and not archived!And to incorprate OP second whish,SELECT {column name list here}FROM ( SELECT {column name list here}, COUNT(*) OVER (PARTITION BY CostCentre, EN) AS Items FROM CostCentres WHERE Archived = 1 ) AS dWHERE Items > 1OrSELECT a.*FROM CostCentres AS aINNER JOIN ( SELECT CostCentre, EN FROM CostCentres WHERE Archived = 1 GROUP BY CostCentre, EN HAVING COUNT(*) > 1 ) AS b ON b.CostCentre = a.CostCentre AND b.EN = a.ENWHERE a.Archived = 1
E 12°55'05.25"N 56°04'39.16"