8 rows in set (0.00 sec)
mysql>
SELECT * FROM test2;
+------+
| a2
|
+------+
|
1 |
|
3 |
|
1 |
|
7 |
|
1 |
|
8 |
|
4 |
|
4 |
+------+
8 rows in set (0.00 sec)
mysql>
SELECT * FROM test3;
+----+
| a3 |
+----+
|
2 |
|
5 |
|
6 |
|
9 |
| 10 |
+----+
5 rows in set (0.00 sec)
mysql>
SELECT * FROM test4;
+----+------+
| a4 | b4
+----+------+
|
1 |
3 |
|
2 |
0 |
|
3 |
1 |
|
4 |
2 |
|
5 |
0 |
|
6 |
0 |
|
7 |
1 |
|
8 |
1 |
|
9 |
0 |
| 10 |
0 |
+----+------+
10 rows in set (0.00 sec)
13.1.12.
CREATE VIEW
CREATE
[OR REPLACE]
[ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]
[DEFINER = {
[SQL SECURITY { DEFINER | INVOKER }]
VIEW
view_name
AS
select_statement
[WITH [CASCADED | LOCAL] CHECK OPTION]
The
CREATE VIEW
clause is given. This statement was added in MySQL 5.0.1. If the view does not exist,
REPLACE VIEW
the same as
The
select_statement
select from the view, you select in effect using the
select from base tables or other views.
The view definition is "frozen" at creation time, so changes to the underlying tables afterward do not
affect the view definition. For example, if a view is defined as
added to the table later do not become part of the view.
CREATE VIEW
|
Syntax
user
| CURRENT_USER }]
[(column_list)]
statement creates a new view, or replaces an existing one if the
is the same as
CREATE
ALTER
VIEW.
is a
SELECT
Syntax
VIEW. If the view does exist,
statement that provides the definition of the view. (When you
statement.)
SELECT
SELECT *
1050
OR REPLACE
CREATE OR
CREATE OR REPLACE VIEW
select_statement
on a table, new columns
is
can
Need help?
Do you have a question about the 5.0 and is the answer not in the manual?
Questions and answers