大家谁能帮我看一个MSSQL转为MYSQL的触发器怎么实现:
create trigger tg_updIO --修改收入支出
on ioT
for update
as
declare @t datetime,@no int
if
update(ioname) or
update(ioMoney) or
update(aTypeNo) or
update(bTypeNo) or
update(myActNo) or
update(outActNo) or
update(ioTime) or
update(re)
begin
set @t = getdate()
set @no = (select ioNo from deleted)
update ioT set updTime = @t,updTimes=updTimes+1 where ioNo =@no
end
GO主要是这里面确定当修改某个特定的值的时候才触发,其它值不触发,如何实现?在MSSQL中if update(id) beging ... end
在MySQL中如何写?
create trigger tg_updIO --修改收入支出
on ioT
for update
as
declare @t datetime,@no int
if
update(ioname) or
update(ioMoney) or
update(aTypeNo) or
update(bTypeNo) or
update(myActNo) or
update(outActNo) or
update(ioTime) or
update(re)
begin
set @t = getdate()
set @no = (select ioNo from deleted)
update ioT set updTime = @t,updTimes=updTimes+1 where ioNo =@no
end
GO主要是这里面确定当修改某个特定的值的时候才触发,其它值不触发,如何实现?在MSSQL中if update(id) beging ... end
在MySQL中如何写?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货