Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用于从select查询创建表的MySQL语法_Mysql_Sql - Fatal编程技术网

用于从select查询创建表的MySQL语法

用于从select查询创建表的MySQL语法,mysql,sql,Mysql,Sql,我正在尝试使用 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 (selec

我正在尝试使用

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)