当前位置:网站首页>Mysql视图
Mysql视图
2022-08-02 12:56:00 【GSX_MI】
- 视图是一个虚拟表,其内容由查询定义。同真实的表一样,视图包含一系列带有名称的列和行数据。视图的数据变化会影响到基表,基表的数据变化也会影响到视图。
1.基本使用
(1)创建视图
create view 视图名 as select语句;
(2)案例

(3)子表,也有对应的空间和文件
- 查询出来的内容形成一个新的表,只在内存中存在;
- 只有表结构,没有数据。

(4)修改了视图,对基表数据有影响

(5)修改了基表,对视图有影响

(6)删除视图

2.视图规则与限制
- 与表一样,必须唯一命名(不能出现同名视图或表名)
- 创建视图数目无限制,但要考虑复杂查询创建为视图之后的性能影响
- 视图不能添加索引,也不能有关联的触发器或者默认值
- 视图可以提高安全性,必须具有足够的访问权限
- order by 可以用在视图中,但是如果从该视图检索数据 select 中也含有 order by ,那么该视图中的order by 将被覆盖
- 视图可以和表一起使用
- 视图中的数据来源于基表
边栏推荐
猜你喜欢

wx-wow(微信小程序动效库)

OpenFeign设置header的3种方式

SQL Server 2014 installation tutorial (nanny-level graphic tutorial)

How to better assess credit risk?Just watch this scorecard model live

liunx基础命令讲解

js stopwatch countdown plugin

Scala基础语法入门(三)Scala中的各种运算符

FreeRTOS实验--一个函数创建多个任务

svg balloon rises explosion js special effect
![PHP+MYSQL [Student Information Management System] (Minimalist Edition)](/img/86/d5d39eef0600acabbf3ac16c255c18.png)
PHP+MYSQL [Student Information Management System] (Minimalist Edition)
随机推荐
LeetCode_139_单词拆分
30 lines of code to realize serverless real-time health code recognition -- operation manual
PHP+MYSQL【学生信息管理系统】(极简版)
Detailed explanation of network flow (what information can the flow network diagram generally reflect)
Interpretation of new features | MySQL 8.0 GIPK invisible primary key
FreeRTOS--stack experiment
为什么IDEA连接mysql Unable to resolve table 编译报错但是可以运行
.Net 5.0快速上手 Redis
js真3d柱状图插件
SQL Server 2019 installation error 0 x80004005 service there is no timely response to the start or control request a detailed solution
动态组件-component
FreeRTOS creation tasks - dynamic creation, static creation
[b01lers2020]Welcome to Earth-1
WPF效果第一百九十三篇之登录实现
photo-sphere-viewer Chinese documentation
selenium chrome driver运行时的cannot determine loading status from target frame detached问题
String concatenation in SQL
In-depth analysis and use of Ribbon load balancing
PGSQL database to realize the import and export
国产 GPU 创业潮 喧嚣下的资本游戏