By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE stuff(
id INTEGER NOT NULL
,name VARCHAR(60) NOT NULL
,city VARCHAR(60) NOT NULL
);
INSERT INTO stuff(id,name,city) VALUES
(904834,'jim','London')
, (904835,'jim','London')
, (90145,'Fred','Paris')
, (90132,'Fred','Paris')
, (90133,'Fred','Paris')
, (923457,'Barney','New York')
;
Records: 6 Duplicates: 0 Warnings: 0
SELECT
t.*
FROM (
SELECT
s.*
, COUNT(*) OVER (PARTITION BY s.name, s.city) AS qty
FROM stuff s
) t
WHERE t.qty > 1
ORDER BY t.name, t.city
id | name | city | qty |
---|---|---|---|
90145 | Fred | Paris | 3 |
90132 | Fred | Paris | 3 |
90133 | Fred | Paris | 3 |
904834 | jim | London | 2 |
904835 | jim | London | 2 |