views:

18

answers:

1

I am looking for the most efficient way to update a table in the following way.

If field A has a value in it and the contents of field b are being removed (null)then just update field b to null

If field A has no value in it and field b is being updated to null then delete row.

I'm a MYSQL newbie and am aware of insert/update/delete but am wondering if there is another command that would do the above.

Thanks in advance.

+2  A: 

It sounds like you want a trigger.

Matt Kane
Thanks v much Matt
Textus