views:

46

answers:

1

Hello,

I wanted to know if there is a way I can directly increment the value of a column without reading the current value. something like:

update table `user` set cnt = cnt+1

The above statement gave me a syntax error, but I am sure there has to be something for it.

Thanks

+7  A: 

It's just UPDATE, not UPDATE TABLE.

zerocrates
+1: Supporting link to documentation: http://dev.mysql.com/doc/refman/5.0/en/update.html
OMG Ponies
cool .. thnx . I love this forum :)
p1