Update on condition

2004-08-10 Thread Scott Haneda
I need to do a certain update based on a condition: MySql4 Update table set bounce_count = bounce_count+1 is the basic query, somewhere in there I need to only do a if bounce_count+1 10 then update status = 'bounced_out' -- - Scott

RE: Update on condition

2004-08-10 Thread Lachlan Mulcahy
August 2004 8:28 AM To: MySql Subject: Update on condition I need to do a certain update based on a condition: MySql4 Update table set bounce_count = bounce_count+1 is the basic query, somewhere in there I need to only do a if bounce_count+1 10 then update status = 'bounced_out

Re: Update on condition

2004-08-10 Thread Michael Stassen
How about UPDATE table SET bounce_count = bounce_count+1, status = if(bounce_count 9, 'bounced_out', status) WHERE ...; Michael Scott Haneda wrote: I need to do a certain update based on a condition: MySql4 Update table set bounce_count = bounce_count+1 is the basic query, somewhere

Re: Update on condition

2004-08-10 Thread Michael Stassen
9, 'bounced_out', status) WHERE ...; Michael Scott Haneda wrote: I need to do a certain update based on a condition: MySql4 Update table set bounce_count = bounce_count+1 is the basic query, somewhere in there I need to only do a if bounce_count+1 10 then update status = 'bounced_out