I have two table 

**Brands Table**

It is a list of brand\_id chosen by the Particular user. 

```
id_autoicrement | user_id |  brand_id 

              1 |   5     |    7
              2 |   5     |    3
              3 |   5     |    1
              4 |   9     |    3
              5 |   9     |    7
              6 |   2     |    3
              7 |   2     |    7
              8 |   4     |    3

```

**Product Table**

It is a list of product\_id chosen by the Particular user. 

```
id_autoicrement | user_id |  product_id 

              1 |   5     |    4
              2 |   5     |    1
              3 |   5     |    2
              4 |   9     |    1
              5 |   9     |    4
              6 |   2     |    1
              7 |   2     |    4
              8 |   4     |    1

```

**Edit**

Sorry i got it wrong. 
I want the list of brand\_id and product\_id which are taken by same number of users whose pair of brand\_id and product\_id values are same. above tables are same.

```
User A                              User B

brand_id  | product_id               brand_id  | product_id 

       1  | 2                               1  | 3
          | 3                               2

```

Same number of pairs by different user...

```
User A has two pairs                              User B has two paris

brand_id 1 and product_id 2                       brand_id 1 and product_id 3
brand_id 1 and product_id 3                       brand_id 2 and product_id 3

```

Result should be like 

```
brand_id  product_id -> combination
  1          2       -> 1
  1          3       -> 2
  2          3       -> 1

```

thanks in Advance.