当前位置:网站首页>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 将被覆盖
- 视图可以和表一起使用
- 视图中的数据来源于基表
边栏推荐
- Object.entries()
- PHP+MYSQL [Student Information Management System] (Minimalist Edition)
- WeChat applet getPhoneNumber interface code=40013
- RESTful 风格(详细介绍 + 案例实现)
- Taurus.MVC V3.0.3 microservice open source framework released: Make the evolution of .NET architecture easier in large concurrency.
- Data Lake (3): Hudi Concept Terminology
- 为什么IDEA连接mysql Unable to resolve table 编译报错但是可以运行
- String concatenation in SQL
- .Net 5.0快速上手 Redis
- There are several ways to jump to js source code, jump on the current page, jump on the blank page
猜你喜欢
ThinkPHP 5.1反序列化分析和poc
SQL Server 2019安装错误0x80004005 服务没有及时响应启动或控制请求详细解决方法
A powerful js pop-up alert plugin
Openlayers Quick Start Tutorial
js炫酷仪表盘插件
js cool dashboard plugin
js semi-circle loading progress animation js special effects
JS中的闭包
SQL Server 2014 installation tutorial (nanny-level graphic tutorial)
FreeRTOS creation tasks - dynamic creation, static creation
随机推荐
网络流详解(流网图一般能够反映什么信息)
There are several ways to jump to js source code, jump on the current page, jump on the blank page
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
zabbix automated monitoring script
Js scratchable latex style draw plug-in
LeetCode_139_word split
First acquaintance of scrapy framework 1
qt 编译报错 No rule to make target
WeChat applet getPhoneNumber interface code=40013
svg气球升起爆炸js特效
SQL Server如何建表
SQL Server 数据库之生成与执行 SQL 脚本
FreeRTOS创建任务--动态创建、静态创建
SQL Server database generation and execution of SQL scripts
SQL Server 2014安装教程(保姆级图解教程)
pig4cloud服务架构使用
UAC绕过学习-总结
图神经网络(GNN)的简介「建议收藏」