具有条件的MySQL更新触发器(MySQL Update Trigger with Conditions)
我有一个PHP应用程序,通过TEST15将'Pass','Fail'或'NA'插入到字段TEST1,TEST2,TEST3 ......中。
我有一个名为OVERALL的字段,如果任何TEST1-TEST15字段包含'Fail',则需要使用'FAIL'自动更新。
我很确定我需要使用包含更新语句和CASE或IF的触发器,但我无法确定确切的语法。
任何人都可以帮助MySQL菜鸟吗? 我正在使用MySQL Server版本:5.1.63-0 + squeeze1(Debian)。
I have a PHP app that inserts 'Pass', 'Fail' or 'NA' into fields TEST1, TEST2, TEST3... through TEST15.
I have a field called OVERALL that needs to be automatically updated with 'FAIL' if any of the TEST1-TEST15 fields contains 'Fail'.
I'm pretty sure I need to use a trigger containing the update statement and either CASE or IF, but I haven't been able to nail down the exact syntax.
Can anyone please help a MySQL noob? I'm using MySQL S
最后
以上就是粗暴过客最近收集整理的关于mysql 条件触发器_具有条件的MySQL更新触发器(MySQL Update Trigger with Conditions)的全部内容,更多相关mysql内容请搜索靠谱客的其他文章。
发表评论 取消回复