UPDATE mytable SET myvalue = myvalue-1 WHERE some_condition

-----Original Message-----
From: Gil G. [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 13, 2001 10:23 AM
To: [EMAIL PROTECTED]
Subject: How to decrement int field?


Hello,

I would really appreciate some help on this, thanks!

I have a colomn with days_left, an integer. I have to write a Perl 
script to run on a cron job once a day and decrement all the fields 
in that column by 1. Is there a query to do this?

Sincerely,

Gil.
-- 
http://planenews.com
PGP public key at:
keskydee.com/gil.asc
ICQ: 3310801

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to