在oracle8以前的版本,要想达到修改字段名的目的 只有重新建表,而oracle8i或以后,可以通过将原有的字段禁止(或删除),然后再增加一个新的字段,老字段不能插入任何数据,达到目的 ALTER TABLE table_name DROP (col1, col2);---for oracle8i or later ALTER TABLE table_name ADD(col1 datatype, clo2 datatype); 所以你还不如: 1. 要先建个新表(新字段)newtable 2. insert into newtable select * from oldtable 3. drop table oldtable 4. rename newtable to oldtable
只有重新建表,而oracle8i或以后,可以通过将原有的字段禁止(或删除),然后再增加一个新的字段,老字段不能插入任何数据,达到目的
ALTER TABLE table_name DROP (col1, col2);---for oracle8i or later
ALTER TABLE table_name ADD(col1 datatype, clo2 datatype);
所以你还不如:
1. 要先建个新表(新字段)newtable
2. insert into newtable select * from oldtable
3. drop table oldtable
4. rename newtable to oldtable
有表A和表B,两表以字段“ab”相关连。
现要把表B中的“b4”字段和数据一起拷贝到表A中,
如何操作?SQL语句如何写?
谢谢!!