Oracle,同一张表,两个字段a和b,a插入或更新值时,想要实时同步给b,怎么实现?
方法一:对两列同时赋值或更新 insert into tab1(a,b) values(1,1); update tab1 set a=1,b=1 where …
方法二:重新定义列b,将其创建为虚拟列 alter table tab1 add b as (a+0) virtual;
使用 insert 和 update trigger。