brownd92 Posted October 21, 2013 Share Posted October 21, 2013 Hi there, I need help with a SQL statement for a multistore, something like: Select all products from SHOPID where MANUFACTURER = 'ManufacturerID' Thanks Link to comment Share on other sites More sharing options...
vekia Posted October 21, 2013 Share Posted October 21, 2013 Hi there, I need help with a SQL statement for a multistore, something like: Select all products from SHOPID where MANUFACTURER = 'ManufacturerID' Thanks select * from ps_product AS p INNER JOIN ps_product_shop AS ps on ps.id_product=p.id_product WHERE p.id_manufacturer='1' AND ps.id_shop='1' you need to define onw id_manufacturer and own id_shop values Link to comment Share on other sites More sharing options...
brownd92 Posted October 21, 2013 Author Share Posted October 21, 2013 Excellent! Thank you for your help One more question if you do not mind. How would I make an update statement to say set all products active = 0 where manufacturer id = 1 and shop id = 1 Thanks again Link to comment Share on other sites More sharing options...
brownd92 Posted October 21, 2013 Author Share Posted October 21, 2013 Essentially I need to set products from different manufacturers either active or not in different shops :-) Link to comment Share on other sites More sharing options...
vekia Posted October 21, 2013 Share Posted October 21, 2013 use this: update ps_product_shop AS ps INNER JOIN ps_product AS p on ps.id_product=p.id_product SET ps.active=0 WHERE p.id_manufacturer='1' AND ps.id_shop='1' Link to comment Share on other sites More sharing options...
brownd92 Posted October 21, 2013 Author Share Posted October 21, 2013 Excellent! Thank you very much! Link to comment Share on other sites More sharing options...
vekia Posted October 21, 2013 Share Posted October 21, 2013 you're welcome i marked this topic as [solved] if you need any other queries related to this case - just continue discussion below with regards, Milos 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