Learning Notes-mysql_ View

Source: Internet
Author: User

View:

create [or replace] [algorithm ={undefined|merge|temptable}]

View View_name [(column_list)]

As Select_statement

[With [cascaded|local] Check option]

Replace replaces the view you have created

algorithm for algorithm view selection

Undefind MySQL will automatically select the algorithm

Merge merges the view statement used with the view definition so that some part of the view definition supersedes the part of the statement

TempTable The result of the view into a temporary table, and then executes the statement with a temporary table

View_name The name of the view

column_list as attribute column

Select_statement represents the select statement

The WITH [cascaded|local] Check Option parameter indicates that the view is guaranteed to be within the view's permission range when updating

cascaded is the default value, indicating that the view is updated so that the conditions of the associated view and table are met

Local means that when the view is updated, the conditions defined by the view itself are met


To view the view:

Desc view_name;

To view basic information about a view:

Show table status like ' view name ';


To view more information about a view :

Show CREATE VIEW name ;


Viewing View details in the Views table

SELECT * from Information_schema.views;


To modify a view:

Create or Replace view statement modification

Or:

alter [Algorithm ={undefined|merge|temptable}]

View View_name [(column_list)]

As Select_statement

[With [cascaded|local] Check option]

To update the view:

Insert Update Delete statement operation view as Table


To delete a view:

Drop view [if exists]]

View_name[.view_name] ...

[Restrict|cascade]




Learning Notes-mysql_ View

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.