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 の 1 つのレコードをビュー内の 2 つのレコードにするビューを作成することです。
CREATE VIEW Foo as
select types.type, bar.value from
(select 8 as type UNION ALL select 9 as type) types, Bar bar