Table is mutating, trigger/function may not see it (stopping an average grade from dropping below 2.5)

前端 未结 6 1026
半阙折子戏
半阙折子戏 2020-12-03 18:01

Here\'s the problem:

Create a trigger that prevents any change to the taking relation that would drop the overall average grade in any particular class below 2.5. No

6条回答
  •  [愿得一人]
    2020-12-03 18:29

    I had the same issue and I noticed that if you do a select on the same table you put the trigger on you may/will get this problem. You can remove FOR EACH ROW or use the data in :New to do the calculation (if possible) and then make the update.

    In your case it will make more sense to use separate table to have the avg_grade per semester.

提交回复
热议问题