MySQL不支持insert into table_name select column_list from source_table的语法,取而代之的是:
create table new_table (select column_list from source_table)
MySQL不支持insert into table_name select column_list from source_table的语法,取而代之的是:
create table new_table (select column_list from source_table)
MySQL的delete from语句后面如果有子查询,那么子查询中不允许有where条件,下面是一个变通的方法:
drop table tmp_dummy_data
create table tmp_dummy_data
select key_columns
from source_table
group by key_columns
having count(*)>1
delete from source_table
where key_columns in (select key_columns
from tmp_dummy_data
)