gpt4 book ai didi

sql - 如何从 View 中删除列

转载 作者:行者123 更新时间:2023-12-04 03:45:08 26 4
gpt4 key购买 nike

我正在尝试从 View 中删除一列,但似乎无法执行此操作,因为显然缺少关键字。有人可以告诉我我错过了什么吗?

ALTER VIEW REORDERINFO DROP COLUMN name;

再次尝试后,我得到以下信息:
SQL> ALTER VIEW REORDERINFO
AS SELECT isbn,title, phone
FROM books JOIN publisher USING (pubid);

ERROR at line 2: ORA-00922: missing or invalid option

最佳答案

您不能使用 ALTER VIEW用于删除列。要重新创建没有列的 View ,请使用 CREATE OR REPLACE VIEW .

来自 Oracle documentation :

Use the ALTER VIEW statement to explicitly recompile a view that is invalid or to modify view constraints.

enter image description here



来源:Oracle® 数据库
SQL 语言引用
11g 第 2 版 (11.2)
E26088-01

关于sql - 如何从 View 中删除列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12660444/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com