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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -