当前位置:网站首页>View analysis
View analysis
2022-06-26 06:19:00 【Oh no, less hair】
1. An understanding of trying
Views are not real tables , Nor does it really exist in the database , It's a virtual table . My most direct understanding of views is the results of joint queries on a table or multiple tables , Applicable to query , Not applicable for updating , Relative to table , Views have the following advantages :
- Simple : View is sql The result returned by executing the query statement , Users do not need to care about the corresponding table structure 、 Association and screening criteria .
- Security : Only let the user see the result set that the user needs to see , It can protect some private information .
2. View creation
- Single table query creates a view
create view [ View name ]
select [ Name ]
from [ Table name ]
where [ Conditions ]
- Multi table joint query to create view
create view [ View name ]
select [ Name ]
from [ surface 1],[ surface 2]
where [ Conditions ]
3. View view
There is no difference between the view and the normal table , It's all about execution select Statement to query
select * from 【 View name 】
4. Modify the view
- Use create or replace view sentence
create or replace view 【 View name 】
( Name ) as select 【 Name 】 from 【 Table name 】
- Use alter Statement to modify
alter view 【 View name 】 (【 Name 】)
as select 【 Name 】 from 【 Table name 】
5. Undo view
drop view 【 View name 】
边栏推荐
猜你喜欢

Library management system

Install pyinstaller

消息队列-消息事务管理对比

数据治理工作的几种推进套路

ByteDance starts the employee's sudden wealth plan and buys back options with a large amount of money. Some people can earn up to 175%
Customer Stories | Netease spring breeze: the "spring breeze" of the fun industry, reaching out to all areas through in-depth interaction

EFK昇級到ClickHouse的日志存儲實戰

Import / export function implementation

MVC source code sharing

Use the fast proxy to build your own proxy pool (mom doesn't have to worry about IP being blocked anymore)
随机推荐
Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could
Application of cow read / write replication mechanism in Linux, redis and file systems
Zotero文献管理工具之Jasminum(茉莉花)插件
Introduction to canal deployment, principle and use
Work accumulation - problems encountered in using ThreadLocal in web requests
New generation engineers teach you how to play with alluxio + ml (Part 1)
Logstash——使用throttle过滤器向钉钉发送预警消息
PyTorch使用多GPU并行训练及其原理和注意事项
Summary of JVM interview focus (II) -- garbage collector (GC) and memory allocation strategy
Deeply uncover Ali (ant financial) technical interview process with preliminary preparation and learning direction
Library management system
University Information Management System
numpy. exp()
How to select and build a real-time data warehouse scheme
Zotero使用之自定义参考文献格式
Volatile application scenarios
个人博客系统需求分析
Basic construction of SSM framework
MySQL-07
Evolution history of qunar Bi platform construction