Please tell me how to select the number of unique inn + publid values.
SELECT t.*, COUNT(inn) OVER (PARTITION BY publid) cnt
FROM table_name t
I thought to put distinct inside count, but it doesn't work that way.
SELECT t.*, COUNT(DISTINCT inn) OVER (PARTITION BY publid) cnt
FROM table_name t