Lucas-911 Posted December 4, 2012 Share Posted December 4, 2012 Hello, I need to update 2000+ fields in the table ps_discount - 'value'. The fields are within 'id_discount' 360812 – 362811 and would like to insert a new £x amount within the 'value' field.... I know its a simple SQL query but cannot figure it out... Any help will be much appreciated... Will send $20 asap as soon SQL query updates all fields correctly Cheers Link to comment Share on other sites More sharing options...
Vinum Posted December 5, 2012 Share Posted December 5, 2012 UPDATE ps_discount SET value=X WHERE id_discount BETWEEN 360812 AND 362811 or UPDATE ps_discount SET value=X WHERE id_discount >= 360812 AND id_discount <= 362811 replace X by your amount Link to comment Share on other sites More sharing options...
NemoPS Posted December 5, 2012 Share Posted December 5, 2012 Small addition: if you want to increase every discount, you can also do this: UPDATE ps_discount SET value=value+X WHERE id_discount BETWEEN 360812 AND 362811 Where x, in this case, is the amount by which you want to increase all discounts 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