tomiiq Posted January 28, 2019 Share Posted January 28, 2019 hello, I have sql request for product attributes count, but server return 2 different results short time. Mostly returns 26000 but in some cases returns 8000 attributes. Can you give me advice about what is wrong on this sql request? I have created module for prestashop where I need this count and problem is only on one customer server propably. SELECT COUNT(pa.id_product_attribute) FROM ps_product_attribute pa JOIN ps_product_attribute_shop pas ON (pas.id_product_attribute = pa.id_product_attribute AND pas.id_shop = 1) JOIN ps_product_shop ps ON (pa.id_product = ps.id_product AND ps.active = 1 AND ps.id_shop = 1) JOIN ps_stock_available sa ON (sa.id_product = pa.id_product AND sa.id_product_attribute = pa.id_product_attribute AND (sa.id_shop = 0 OR sa.id_shop = 1)) WHERE ps.id_shop = 1 AND sa.quantity > 0 AND ps.visibility = 'both' AND ps.active = 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now