Jump to content

How to.. SQL Query... ?


z72diego

Recommended Posts

Hello everyone,

 

I need to make a query in phpMyAdmin that allows me to do the following:

IF cell "active" = 0 in the "ps_product" table, then, "quantity" = 0 in "ps_stock_avaliable" table

How can I express this in SQL applied to all product IDs, from the store?

 

Thank you!!

Link to comment
Share on other sites

So you're wanting to take all products that are not active and set the quantity to 0?

 

Yeah, exactly. If it were the same table I would not have problem in doing the query, but as they are different tables I do not know how to do it ...

 

IF TABLE "ps_product" column active is "0", then:

Column ID.. find this value in table "ps_stock avaliable" and modify column quantity to "0"

 

Something like VLOOKUP en Excel.

 

Thanks dude.

 

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