I have a table like this -
Product | Competitor | Comparison Count
A B 3
C D 5
B A 2
E A 1
And I need a Output for product A, its competitor and the count like this -
Product | Competitor | Comparison Count
A B 5
A E 1
I am using postgresql and am kind of clueless on how to aggregate the Comparison count for product A when it's present on both Product and Competitor columns as above. Any leads would be appreciated. Thanks!