Friends, such a question. There is a table containing the values of the buyer-product type:
| Ваня | Товар 1 | | Ваня | Товар 2 | | Петя | Товар 1 | | Петя | Товар 2 | | Петя | Товар 3 | It is necessary to make a request that counts for each pair of goods, the number of buyers who bought them ie:
Товар 1, Товар 2 - 2 Товар 1, Товар 3 - 1 Товар 2, Товар 3 - 1 I can not imagine how to do it. Tell me which way to dig?