Home » Performance » MySQL » increase int column via UPDATE, without SELECT
increase int column via UPDATE, without SELECT [message #1760] Fri, 07 September 2007 16:55 Go to previous message
kevinjohn  is currently offline kevinjohn
Messages: 2
Registered: September 2007
Junior Member
I'm a tad worried that this is a simple SQL question, and not a MySQL performance question, so if thats the case, my apologies.

I'm looking to increase (or decrease) the value of an int field by a set amount (usually 1), without calling a SELECT statement first.

Right now, i am doing a SELECT to find the value, then doing an UPDATE with the new value.

I hope there is a way of just doing an UPDATE with a function, but i have yet to find it (and my bad english is slowing the search).

Thanks

Kev

P.S. While not a performace quesstion iteself, it would save me 1 DB call everytime i want to do this, which happens alot on my system.

Read Message
Read Message
Previous Topic:replication problem
Next Topic:Data not being retrieved from index
Goto Forum:

  


Current Time: Fri Jul 10 01:24:21 EDT 2009

Total time taken to generate the page: 0.02004 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software

MySQL is a trademark of Sun Microsystems.
InnoDB is a trademark of Oracle Corp.

Percona Performance Forums are a service of Percona, Inc.
Not affiliated with Sun Microsystems or Oracle Corp.