111.Oracle数据库SQL开发之 视图——修改、删除视图

论坛 期权论坛 编程之家     
选择匿名的用户   2021-5-28 16:45   17   0

111.Oracle数据库SQL开发之 视图——修改、删除视图

欢迎转载,转载请标明出处:http://blog.csdn.net/notbaron/article/details/50043091

CREATE OR REPLACE可以彻底替换一个视图。

如下:

store@PDB1> create or replace viewproduct_average_view as select product_type_id,avg(price) average_price fromproducts

where price< 12 group by product_type_id having avg(price) > 11 order byproduct_type_id;

View created.

使用ALTER VIEW可以用来修改视图的约束。从cheap_products_view2中删除cheap_products_view2_price约束。

例如:

store@PDB1> alter view cheap_products_view2 dropconstraint cheap_products_view2_price;

View altered.

删除视图可以通过DROP VIEW可以删除视图。

如下:

store@PDB1> drop view cheap_products_view2;

View dropped.

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP