Jump to content

SQL query - how to find product quantity?


noesac

Recommended Posts

I'm using the following query. I've found that recently, the last few products that I've added all have a quantity of 0 (psproduct.quantity)...which is impossible because if I look in the database, as well as the back office, I can see it's not 0.

At first I thought it was due to using combinations, but that's not the case. I looked at some other products that use combinations and the quantity is correct. It seems to only affect recently added products. Is there something I'm missing with this query?



SELECT DISTINCT psproduct.id_product, psproductlang.name, psproductlang.description, psproduct.price, psproduct.quantity, psproduct.reference, psproduct.active, psproduct.id_category_default

FROM ps_product as psproduct LEFT JOIN ps_product_lang psproductlang ON
psproduct.id_product=psproductlang.id_product LEFT JOIN ps_category_product pscategoryproduct ON
psproductlang.id_product=pscategoryproduct.id_product LEFT JOIN ps_category_lang pscategorylang ON
pscategoryproduct.id_category=pscategorylang.id_category

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...