25
03/18
MySQL使用Union创建视图报错
mysql> select * from test_main; +----+-------+ | id | value | +----+-------+ | 1 | ONE | | 2 | TWO | | 3 | THREE | +----+-------+ 3 rows in set (0.00 sec) mysql> create table test_main2 select * from test_main; Query OK, 3 rows affected (0.04 sec) Records: 3 Duplicates: 0 Warnings: 0 -- 创建视图, sql 语句加了括号, 报错。 CREATE VIEW view_test_main AS ( SELECT * FROM test_main UNION ALL SELECT * FROM test_main2 ); ERROR 1064 (42000): You have an e...