set @table := concat('bak_company', '_', date_format(curdate(), '%y_%m_%d'),'_',time_format(current_time, '%H_%i_%s')); set @qry1 := concat('create table ',@table, ' select * from dbr_company'); prepare run_query from @qry1 ; execute run_query ; CREATE TABLE concat("kkk_company", "_", date_format(CURDATE(), "%y_%m_%d") SELECT * FROM dbr_company SELECT concat('kkk_company', '_', date_format(CURDATE(), '%y_%m_%d'),'_',time_format(CURRENT_TIME, "%H_%i_%s")) SELECT concat("kkk_company", "_", date_format(CURDATE(), "%y_%m_%d"),"_",time_format(CURRENT_TIME, "%H_%i_%s")) CREATE TABLE ( SELECT concat('kkk_company', '_', date_format(CURDATE(), '%y_%m_%d'),'_',time_format(CURRENT_TIME, "%H_%i_%s")) ) SELECT * FROM dbr_company CREATE TABLE `concat("kkk_company", "_", date_format(CURDATE(), "%y_%m_%d"),"_",time_format(CURRENT_TIME, "%H_%i_%s"))` SELECT * FROM dbr_company SELECT CURRENT_TIME; SELECT TIME_FORMAT(CURRENT_TIME, "%H_%i_%s"); TIME_FORMAT(CURRENT_TIME, "%H_%i_%s") concat(date_format(CURDATE(), '%Y_%m_%d'),'_',time_format(CURRENT_TIME, "%H_%i_%s")) set @table := concat("bak_company", "_", date_format(curdate(), "%y_%m_%d"),"_",time_format(current_date, "%H_%i_%s")); set @qry1:= concat('create table ',@table, ' select * from dbr_company'); prepare run_query from @qry1 ; execute run_query ;