From e9afe9d7b40eef2a012149efb0df7f8fdd480489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=81=E7=AB=A0=E5=BD=AC?= <2629351295@qq.com> Date: Sun, 18 Sep 2022 13:29:12 +0000 Subject: [PATCH] =?UTF-8?q?=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 翁章彬 <2629351295@qq.com> --- .../2022-09-15 \350\247\206\345\233\276.md" | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 "01\347\277\201\347\253\240\345\275\254/\347\254\224\350\256\260/2022-09-15 \350\247\206\345\233\276.md" diff --git "a/01\347\277\201\347\253\240\345\275\254/\347\254\224\350\256\260/2022-09-15 \350\247\206\345\233\276.md" "b/01\347\277\201\347\253\240\345\275\254/\347\254\224\350\256\260/2022-09-15 \350\247\206\345\233\276.md" new file mode 100644 index 0000000..344b1f8 --- /dev/null +++ "b/01\347\277\201\347\253\240\345\275\254/\347\254\224\350\256\260/2022-09-15 \350\247\206\345\233\276.md" @@ -0,0 +1,33 @@ +# 视图 + +## 创建视图 + +```sql +create view 视图名(列名) +as(表) +``` + +## 更新视图 + +```sql +update 视图名 set 修改内容 where 条件 + +create view 视图名(列名) +as(新表) +with check option +``` + +## 修改视图 + +```sql +alter view 视图名 as (表) +``` + +## 删除视图 + +```sql +drop view 视图名 +--该语句从数据字典中删除指定的视图定义 +--由该视图导出的其他视图仍在数据字典中,但不能使用,需要删除 +--删除基表时,由该基表导出的所有视图定义都必须显示删除 +``` \ No newline at end of file -- Gitee