日期:2014-05-17 浏览次数:21058 次
SQL> create table tb(t1 int,t2 int,t3 int , t4 int) ; Table created. SQL> create table tb(t1 int,t2 int,t3 int , t4 int) ; Table created. SQL> commit ; Commit complete. SQL> alter table tb modify t4 as (t1+t2+t3) ; alter table tb modify t4 as (t1+t2+t3) * ERROR at line 1: ORA-54026: Real column cannot have an expression SQL> alter table tb drop column t4 ; Table altered. [color=#FF0000]SQL> alter table tb add t4 as (t1+t2+t3) ; [/color] Table altered. SQL> select * from tb ; T1 T2 T3 T4 ---------- ---------- ---------- ---------- 1 1 1 3 2 2 2 6 3 3 3 9 4 4 4 12 5 5 5 15 6 6 6 18 7 7 7 21 8 8 8 24 9 9 9 27 10 10 10 30 10 rows selected.