So let's say I have an int column in MySQL. I want to update that column by adding to it, without running a SELECT query to get the number and add it. Is this possible?
update tablename set field = field + 1 where condition
This is a direct MySql update command to do so. You didn't mention if you were using a specific ORM like Hibernate or anything, but this same concept can be applied in HQL etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With