mysql - sql query to modify the selected value from database -


i have table number(int value). if want add or subtract value, how should proceed? ex: value 30. want subtract 7 make 23. should query like?

update table1 set numberfield = numberfield - 7 

if numberfield 30, numberfield = 30 - 7, difference new value of field


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -