guest* Posted March 25, 2011 Share Posted March 25, 2011 I imported some products (about 8.000) and choosed the wrong id_category_default, so I need to change onps_products all products with id_category default 1into 1866 which is the correct id-category.I would be appreciate if somebody can please name a SQL Query for this ? I'm not a coder and don't know SQL-codes. Link to comment Share on other sites More sharing options...
rabacik_pl Posted March 25, 2011 Share Posted March 25, 2011 UPDATE `ps_product` SET `id_category_default` = 'xxxx';xxxx is your category number. If it can be done for some records You need add WHERE clause Link to comment Share on other sites More sharing options...
guest* Posted March 25, 2011 Author Share Posted March 25, 2011 Sorry I'm really a nooby in that. I want to change only some records (about 8.000 from 22.000), not all records, but all with ID 1. So what should I ammend there ?something like this ?WHERE `id_category_default`='1'; Link to comment Share on other sites More sharing options...
guest* Posted March 25, 2011 Author Share Posted March 25, 2011 I tried this one:UPDATE `ps_product` SET `id_category_default`=1866 WHERE `id_category_default`=1;and it worked... Thxs for your help... Link to comment Share on other sites More sharing options...
rabacik_pl Posted March 25, 2011 Share Posted March 25, 2011 UPDATE `ps_product` SET `id_category_default` = 'xxxx' WHERE `id_category_default` =1;I think. Try before:SELECT * FROM `ps_product` WHERE `id_category_default`=1SELECT * FROM `ps_product` WHERE `id_category_default`=1866?? Link to comment Share on other sites More sharing options...
guest* Posted March 25, 2011 Author Share Posted March 25, 2011 Thxs. post was overlapped...Yes the code worked...The message was strange because 0 rows affected ??? But ok it worked. Thxs. 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