Reply to Re: Updating a field

Your name:

Reply:


Posted by Tom on 02/16/07 18:12

On 16 Feb 2007 07:47:40 -0800, Captain Paralytic wrote...
>
>On 16 Feb, 15:45, Rik <luiheidsgoe...@hotmail.com> wrote:
>> On Fri, 16 Feb 2007 16:30:26 +0100, Brian <djswirl@remove_me_yahoo.com>
>> wrote:
>>
>> > Hi there
>>
>> > I'm sure this can be done but not sure of the MSQL code
>>
>> > I want to run an update statement on a field where it adds
>> > X to want ever is already in the field?
>>
>> > e.g.
>> > field = 10
>> > Add = 5
>> > update field add 5 to field so field now = 15
>> > but if field was null then field now = 5
>>
>> > Brian
>>
>> UPDATE `table` SET `field` = `field` + 5
>>
>> --
>> Rik Wasmus
>
>But that doesn't work if the field is currently NULL. See my post for
>the solution.
>

Thanks for the null tip.


Tom
--
Newsguy.com - Basic Accounts $39.95 / 12 months
75+ days of Binary and Text Retention!
Higher levels of article completion!
Broader coverage of newsgroups

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация