Created
September 20, 2017 14:24
-
-
Save kmarenov/6754c013c28266b291b9e09226ba9cda to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT COUNT(t.product_id) | |
| FROM | |
| (SELECT ppc.product_id AS product_id | |
| FROM product__product_category ppc | |
| LEFT JOIN classification__category cc ON ppc.category_id = cc.id | |
| WHERE cc.context = 'brands' | |
| GROUP BY ppc.product_id | |
| HAVING COUNT(ppc.category_id) > 1 | |
| ) AS t; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment