table-backup.sql 1.3 KB

123456789101112131415161718192021222324252627282930
  1. set @table := concat('bak_company', '_', date_format(curdate(), '%y_%m_%d'),'_',time_format(current_time, '%H_%i_%s'));
  2. set @qry1 := concat('create table ',@table, ' select * from dbr_company');
  3. prepare run_query from @qry1 ;
  4. execute run_query ;
  5. CREATE TABLE concat("kkk_company", "_", date_format(CURDATE(), "%y_%m_%d") SELECT * FROM dbr_company
  6. SELECT concat('kkk_company', '_', date_format(CURDATE(), '%y_%m_%d'),'_',time_format(CURRENT_TIME, "%H_%i_%s"))
  7. SELECT concat("kkk_company", "_", date_format(CURDATE(), "%y_%m_%d"),"_",time_format(CURRENT_TIME, "%H_%i_%s"))
  8. CREATE TABLE ( SELECT concat('kkk_company', '_', date_format(CURDATE(), '%y_%m_%d'),'_',time_format(CURRENT_TIME, "%H_%i_%s"))
  9. ) SELECT * FROM dbr_company
  10. CREATE TABLE `concat("kkk_company", "_", date_format(CURDATE(), "%y_%m_%d"),"_",time_format(CURRENT_TIME, "%H_%i_%s"))` SELECT * FROM dbr_company
  11. SELECT CURRENT_TIME;
  12. SELECT TIME_FORMAT(CURRENT_TIME, "%H_%i_%s");
  13. TIME_FORMAT(CURRENT_TIME, "%H_%i_%s")
  14. concat(date_format(CURDATE(), '%Y_%m_%d'),'_',time_format(CURRENT_TIME, "%H_%i_%s"))
  15. set @table := concat("bak_company", "_", date_format(curdate(), "%y_%m_%d"),"_",time_format(current_date, "%H_%i_%s"));
  16. set @qry1:= concat('create table ',@table, ' select * from dbr_company');
  17. prepare run_query from @qry1 ;
  18. execute run_query ;