开发者

Update a field to null or delete row if another field is null

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

If fie开发者_Python百科ld 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?


It sounds like you want a trigger.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜