z72diego Posted March 21, 2017 Share Posted March 21, 2017 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" tableHow can I express this in SQL applied to all product IDs, from the store? Thank you!! Link to comment Share on other sites More sharing options...
jetway Posted March 22, 2017 Share Posted March 22, 2017 So you're wanting to take all products that are not active and set the quantity to 0? Link to comment Share on other sites More sharing options...
z72diego Posted March 22, 2017 Author Share Posted March 22, 2017 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 More sharing options...
z72diego Posted March 26, 2017 Author Share Posted March 26, 2017 Any? 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