Jump to content

Help with some SQL


Recommended Posts

I'm developing some code to create a file for another process of ours and was wondering if anyone could help out on this SQL.

SELECT ps_product_lang.description_short AS description, 
      ps_product.id_product AS prod_id, 
      ps_product.quantity AS quantity, 
      ps_product.price AS price,
      ps_product.wholesale_price AS wholesale_price,
      ps_manufacturer.name AS manufacturer,
      ps_category_lang.name as category,
      ps_supplier.name as supplier
FROM ps_product 
LEFT JOIN ps_product_lang ON ps_product_lang.id_product = ps_product.id_product 
 AND ps_product_lang.id_lang = 1 -- use lang variable here
LEFT JOIN ps_manufacturer ON ps_manufacturer.id_manufacturer  = ps_product.id_manufacturer
LEFT JOIN ps_category_product ON ps_category_product.id_product = ps_product.id_product
LEFT JOIN ps_category_lang ON ps_category_lang.id_category = ps_category_product.id_category 
 AND ps_category_lang.id_lang = 1 -- use lang variable here
LEFT JOIN ps_supplier ON ps_supplier.id_supplier = ps_product.id_supplier
ORDER BY ps_product.id_product

I need to know how to work in the sub-categories.

Share this post

Link to post
Share on other sites

  • 2 weeks later...

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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More