需要写一个触发器,当B表发生插入删除更新的时候 执行此触发器,需求如下:
user_nouser_saluser_taretuser_ticheng16表B结构project_user_noproject_ticheng2project_use...
user_no user_sal user_taret user_ticheng16
表B 结构
project_user_no project_ticheng2 project_user_lirun project_amount
其中a.user_no = b.project_user_no
条件:sum(b.project_amount)<0.4*a.user_target and sum(b.project_user_lirun)<3*a.user_sal set a.user_ticheng16=0*b.project_ticheng2
sum(b.project_amount)<0.4*a.user_target || sum(b.project_user_lirun)<3*a.user_sal set a.user_ticheng16=0.4*b.project_ticheng2 展开
表B 结构
project_user_no project_ticheng2 project_user_lirun project_amount
其中a.user_no = b.project_user_no
条件:sum(b.project_amount)<0.4*a.user_target and sum(b.project_user_lirun)<3*a.user_sal set a.user_ticheng16=0*b.project_ticheng2
sum(b.project_amount)<0.4*a.user_target || sum(b.project_user_lirun)<3*a.user_sal set a.user_ticheng16=0.4*b.project_ticheng2 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询