I can't imagine why you need it, but this should be close:
SELECT
id, name, job,
CASE
WHEN ROW_NUMBER() OVER (PARTITION BY id,job,name ORDER BY id) = 1
THEN COUNT(*) OVER (PARTITION BY id,job,name)
ELSE 0 END
FROM tab
Dieter
↧