Example:
--------------------------
| product | store |
--------------------------
| abc1 | 2 |
| abc2 | 2 |
| abc1 | 3 |
| abc1 | 5 |
| abc1 | 4 |
| abc2 | 3 |
| abc3 | 3 |
| abc1 | 1 |
| abc4 | 3 |
| abc5 | 3 |
--------------------------
I am trying to get the percent of shared products between different stores and sort them by stores with the biggest overlap.
I am not really sure how to approach this problem.
Fiddle: https://www.db-fiddle.com/f/bm5c7k7q5qbQY3Qu8t5Gvx/1