I have the following table -
My goal is to return the Company/ID row with the highest "count" respective to a partition done by the ID.
So the expected output should look like this :
My current code returns a count partitioned on all ids. I just want it to return the one with the highest count.
Current code -
select distinct Company, Id, count(*) over (partition by ID)
from table1
where company in ("Facebook","Apple")
My output:


