Counting duplicate instances within column in SQL when grouping by another column
This should do what you require (fiddle):

Create table j (tid serial, nom text, jid text);

Insert into j (nom, mid) values
('Sam', 'a'),
('Sam', 'b'),
('Ali', 'b'),
('Tim', 'c'),
('Tim', 'd'),
('Finn', 'a'),
('Mona', 'c'),
('Bill', 'z'), 
('Sam',  'x'),
('Sam',  'y'),
('Finn', 'w');


Then:

With dup_jobs AS 
(
  Select jid from j
  Group by jid
  Having count(1) &gt; 1
)
Select j.nom, count(1)
From j
Join dup_jobs dj
  On j.jid = dj.jid 
Group by j.jid
Order by j.jid


Result:

Ali 1
Finn 1
Mona 1
Sam 2
Tim 1



Note that Bill has no jobs in common with anyone else and therefore doesn't appear. Sam's jobs 'x' and 'y' are not shared with anyone else and similarly aren't counted.

Interesting question (+1). p.s. welcome to the forum! :-) Oh, and BTW, in future could you please provide sample table structures (DDL) and data (DML) in the form of a fiddle - it helps us to help you and if there's only one definitive source for the tables and data, it helps prevent errors and duplication of effort.