Gil G. writes:
> 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? I'll leave the the cron job and perl script to you, but decrementing something is done the same way as incrementing something, except that you use '-' instead of '+' (I'm not implying that you didn't know this. I merely found it a good way to introduce the next sentence): UPDATE foo SET bar = bar-1 Forhead-slapping is voluntary. :-D //C - shame on me for not working. :-P Paranoid filter-bait: sql, database, nostril-hair -- Carl Troein - Círdan / Istari-PixelMagic - UIN 16353280 [EMAIL PROTECTED] | http://pixelmagic.dyndns.org/~cirdan/ Amiga user since '89, and damned proud of it too. --------------------------------------------------------------------- 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