我正在尝试使用创建表的永久子集
create table copydata (select a.* from tabla a
left join table b
on st_distance(a.point, b.point) <= 10
and b.x is null)
这可行,但将表“copydata”构建为 InnoDB 表。我需要它是一个 ISAM 表,以便我可以构建空间索引。我已经尝试过
create table copydata (select a.* from tablea a
left join tableb b
on st_distance(a.point, b.point) <= 10
and b.x is null) ENGINE=MyISAM DEFAULT CHARSET=utf8
但这提示语法错误。
我错过了什么?
问候
最佳答案
只需更改语句的顺序:
create table copydata ENGINE=MyISAM DEFAULT CHARSET=utf8 (select a.* from tablea a
left join tableb b
on st_distance(a.point, b.point) <= 10
and b.x is null)
关于从选择查询创建表的 MySQL 语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26320837/