我正在尝试将mysql导出到最后一天的表格
set @filepath='C:\\Db\\Dbtest.csv';
select @lastday := date_sub(curdate(),interval 1 day);
SET @datanewname = '_m2_raw_Data';
SELECT @datalasttablename:=concat(@lastday,@datanewname);
SELECT @query:=CONCAT('SELECT *FROM','`',@datalasttablename,'`',' INTO OUTFILE ','''',@filepath,'''');
PREPARE STMT FROM @query;
EXECUTE STMT;
但它无法执行Select * from 2017-11-09_m2_raw_data
into outfile'c:\ Db \ test.csv'