Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p_qs = Product.objects.raw(""" SELECT 'catalog_category'.'name', 'catalog_product'.'id',
- COUNT ( 'catalog_product'.'category_id') AS 'product_count'
- FROM 'catalog_product'
- INNER JOIN 'catalog_category' ON ('catalog_product'.'category_id' = 'catalog_category'.'id')
- WHERE 'catalog_product'.'price' >= {}
- GROUP BY 'catalog_category'.'name'
- HAVING COUNT('catalog_product'.'category_id') > {}
- """.format(100, 10))
Advertisement
Add Comment
Please, Sign In to add comment