MySql 创建视图:
CREATE VIEW Foo as
select type from (select 8 as type UNION ALL select 9 as type) types;
Windows 上的 MySql 5.7.11:有效,但 mysql 5.6.25-0ubuntu0.15.04.1(Ubuntu):无效。
View's SELECT contains a subquery in the FROM clause
这是从5.6到5.7的变化?我尝试在 Ubuntu 上将 mysql 升级到 5.7,但它在 Ubuntu 上不可用。有什么建议吗?谢谢。
编辑:这个例子是一个测试用例。真实案例是创建一个视图,使 Bar 的一条记录成为视图中的两条记录:
CREATE VIEW Foo as
select types.type, bar.value from
(select 8 as type UNION ALL select 9 as type) types, Bar bar