【发布时间】:2015-08-10 07:03:23
【问题描述】:
我想在插入 account_sh 值时自动计算 account_sh 的新记录和所有以前记录中所有列的新总数
这样
id account_sh percentage total
001 50 1 50
当我插入另一条记录时,它将是****
id account_sh percentage total
001 50 0.25 200
002 150 0.75 200
create table main_sh (
id_sh number (9),
account_sh number not null,
percentage_sh number(*,15) generated always as (account_sh/total_sh),
total_sh number generated always as select sum(account_sh) from main_sh);
【问题讨论】:
标签: oracle oracle11g oracle10g oracle-sqldeveloper sqlplus