Freedom-n-Democrazy Posted September 12, 2011 Share Posted September 12, 2011 I have this: +------+---------------+------------+ | id | primarycolour | pricerange | +------+---------------+------------+ | 1 | black | 1 | | 2 | brown | 2 | +------+---------------+------------+ ... and I want to change the pricerange of "id 2" from 2 to 1. I tried this, but it didn't work: UPDATE products(pricerange) where id=2 VALUES(1); Does anyone know how it can be done? Quote Link to comment Share on other sites More sharing options...
Muddy_Funster Posted September 12, 2011 Share Posted September 12, 2011 Where did you get that code? UPDATE products SET pricerange= 1 WHERE WHERE id = 1 Quote Link to comment Share on other sites More sharing options...
Freedom-n-Democrazy Posted September 12, 2011 Author Share Posted September 12, 2011 I made an educated guess. Thanks for that code man, it worked. Quote Link to comment Share on other sites More sharing options...
Muddy_Funster Posted September 12, 2011 Share Posted September 12, 2011 no problem, was just concerned in case someone had posed that syntax in a guide some place. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.