复制一个表的表结构:

create table new_table_name like old_table_name;

删除表中的全部记录:

delete from tablename where 1=1;

mysql将一个表里面的数据批量导入另一个表里:

insert into new_table(`name`,`age`) select `name`,`age` from old_table;
 
mysql获取表1和表2的diff数据(表1里面有,表2里面没有的数据):
 
select `keyword`,`cityId` from table1 where not exists (select `keyword`,`cityId` from table2 where table1.keyword=table2.keyword and table1.cityId=table2.cityId)

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-08
  • 2022-12-23
  • 2022-12-23
  • 2023-02-07
  • 2021-11-21
猜你喜欢
  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
  • 2022-01-21
  • 2022-02-28
相关资源
相似解决方案