触发器写法
有表A(A_1,A_2) 表B(B_1,B_2)
假设update前A_1叫old_A_1,old_A_2
假设update后A_1叫new_A_1,new_A_2
if old_A_2 ='UP' then
UPdate B set B_2='UUUUU' where old_A_1=B_1;
if old_A_2 ='DOWN' then
UPdate B set B_2='DDDDD' where old_A_1=B_1;
if new_A_2='UP' then
UPdate B set B_2='FFFF' where new_A_1=B_1;
if new_A_2='DOWN' then
UPdate B set B_2='GGGG' where new_A_1=B_1;
假设update前A_1叫old_A_1,old_A_2
假设update后A_1叫new_A_1,new_A_2
if old_A_2 ='UP' then
UPdate B set B_2='UUUUU' where old_A_1=B_1;
if old_A_2 ='DOWN' then
UPdate B set B_2='DDDDD' where old_A_1=B_1;
if new_A_2='UP' then
UPdate B set B_2='FFFF' where new_A_1=B_1;
if new_A_2='DOWN' then
UPdate B set B_2='GGGG' where new_A_1=B_1;
...全文
相关推荐
SqlServer触发器写法案例
最近用到触发器,研究了一下,现给菜鸟的你分享下。。
MySQL与SQL的触发器的不同写法
<触发器作用> 当在SQL、MySQL数据库中一张表中插入一条记录时,触动触发器,使同一数据库的另一张表插入相同记录。 在学习的过程中,发现两者的写法是不同的。 <触发器作用> 1、在SQL中建立两张表sql_test,sql_tem。(两张表的字段是一样的) 代码如下: create table sql_test ( id int, name varchar(16) ) create table sql_tem ( id int, name varchar(16) ) 代码如下: /*SQL的触发器写法*/ create trigger insert_sql_test on sql_t
sql 触发器的写法
比方说建了一张表,其中的两列为‘是否会员’和‘金额’,金额根据是否会员来定的,比如说如果是会员,则金额为500,不是会员则金额为1000,怎么在这个表上建立触发器,
informix procedure&trigger写法教程
informix procedure&trigger写法教程
从D触发器作9分频来分析如何用触发器作分频器
如何用触发器搭建一个分频器/计数器,用特殊的循环位移方法来设计序列发生器,从而完成分频。涉及到的知识点:触发器作计数器,如何将信号延迟半个时钟周期


