2014/12/09 14:25 +, Martin Mueller
I'm trying to get my feet wet with 'if' and 'when' uses in mysql. it would be
very useful for update operations, but I can't get it right.
If I read the documentation correctly, it should be possible to say
something like
UPDATE X
if WORD like '
Hello Martin,
On 12/9/2014 9:25 AM, Martin Mueller wrote:
I'm trying to get my feet wet with 'if' and 'when' uses in mysql. it would
be very useful for update operations, but I can't get it right.
If I read the documentation correctly, it should be possible to say
something like
UPDATE X
if W
You can use your login inline with nested IF expressions:
insert into foo(id,comment)
values(17, IF(WORD like 'a%','a',IF(word like 'b%','b',null)));
On Tue, Dec 9, 2014 at 9:50 AM, wagnerbianchi.com
wrote:
> You can do that, but, perhaps the only chance to have it updating a row
> bas
You can do that, but, perhaps the only chance to have it updating a row
based on a condition is developing a Stored Procedure or even having a
BEFORE Trigger associated with the main table. Those ways, you can test the
sent value and decide on what UPDATE you will execute afterwards. Consider
that
I'm trying to get my feet wet with 'if' and 'when' uses in mysql. it would
be very useful for update operations, but I can't get it right.
If I read the documentation correctly, it should be possible to say
something like
UPDATE X
if WORD like 'a%' SET COMMENT = 'a'
elseif WORD like 'b%' SET CO