Database-mysql View

Source: Internet
Author: User

A view is a virtual table (not a real one), which is essentially "fetching dynamic datasets from SQL statements and naming them", using "name" to get a result set, and using it as a table

One: Create a view

 CREATE VIEW viewname as select Tname from Table1,table2 where condition

 from student; Query OK, 0 rows affected (0.02 sec) MariaDB [test2]> show tables; +-----------------+| Tables_in_test2 |+-----------------+| A               | | b               | | student         | | Student2 in         Set (0.00 sec)
Two: Delete view

 Drop View ViewName

MariaDB [test2]> drop view student2; Query OK, 0 rows affected (0.00 sec) MariaDB [test2]> show tables; +-----------------+| Tables_in_test2 |+-----------------+| A               | | b               | | Student in          Set (0.00 sec)

Three: Modify the View

 Alter VIEW viewname as select Tname from Table1,table2 where condition

  

 from A; Query OK, 0 rows affected (0.00 sec)

Database-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.