在Oracle中的关键字之后更改表 [英] Alter table after keyword in Oracle
本文介绍了在Oracle中的关键字之后更改表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
ALTER TABLE testTable ADD column1 NUMBER(1) DEFAULT 0 NOT NULL AFTER column2;
为什么我也不能在Oracle中使用mySql语法?上面的命令在MySql中有效.你能给我一个等效的东西吗?
Why can't I use mySql syntax in Oracle too? The above command works in MySql. Can you give me an equivalent that works?
Error report:
SQL Error: ORA-01735: invalid ALTER TABLE option
01735. 00000 - "invalid ALTER TABLE option"
我在问我提供的Oracle命令中是否有任何方法可以使用after子句?
I am asking if there is any way to use after clause in Oracle command that I provided?
推荐答案
因为SQL是关系代数.不必关心表中何处"列的位置,只关心它们是否存在.
Because SQL is a relational algebra. It doesn't care one bit about "where" columns are located within a table, only that they exist.
要使其在Oracle中工作,只需摆脱after
子句. alter table
的Oracle文档在此处,但是归结为:
To get it to work in Oracle, just get rid of the after
clause. The Oracle documentation for alter table
is here but it boils down to:
alter table testTable
add ( column1 number(1) default 0 not null )
alter table
命令没有否 after
子句.
这篇关于在Oracle中的关键字之后更改表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文