为什么要加上一对括号呢?mysql> create table r (a int,r int); Query OK, 0 rows affected (0.08 sec)mysql> create table u (a int,d int); Query OK, 0 rows affected (0.05 sec)mysql> CREATE ALGORITHM=TEMPTABLE VIEW view_u(u,f) -> as SELECT a,r from r UNION ALL SELECT a,d from u; Query OK, 0 rows affected (0.03 sec)mysql>
Query OK, 0 rows affected (0.08 sec)mysql> create table u (a int,d int);
Query OK, 0 rows affected (0.05 sec)mysql> CREATE ALGORITHM=TEMPTABLE VIEW view_u(u,f)
-> as SELECT a,r from r UNION ALL SELECT a,d from u;
Query OK, 0 rows affected (0.03 sec)mysql>