Guest User

Untitled

a guest
Jan 7th, 2017
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1.     p_qs = Product.objects.raw(""" SELECT 'catalog_category'.'name', 'catalog_product'.'id',
  2.    COUNT ( 'catalog_product'.'category_id') AS 'product_count'
  3.    FROM 'catalog_product'
  4.    INNER JOIN 'catalog_category' ON ('catalog_product'.'category_id' = 'catalog_category'.'id')
  5.    WHERE 'catalog_product'.'price' >= {}
  6.    GROUP BY 'catalog_category'.'name'
  7.    HAVING COUNT('catalog_product'.'category_id') > {}
  8.        """.format(100, 10))
Advertisement
Add Comment
Please, Sign In to add comment