如果你需要的是建立一个虚拟列,那么只能先将这一列删除,然后再创建一个新的虚拟列 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 expressionSQL> alter table tb drop column t4 ;Table altered.SQL> alter table tb add t4 as (t1+t2+t3) ;
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 expressionSQL> alter table tb drop column t4 ;Table altered.SQL> alter table tb add t4 as (t1+t2+t3) ;
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 3010 rows selected.
--第二个
SQL> create table tb(t1 int,t2 int,t3 int , t4 int) ;Table created.
--修改为
SQL> insert into tb select level , level , level , level from dual connect by level <= 10 ;10 rows created.