在查询中动态表名的使用最好与 Prepared
Staments一起使用 ,在mysql中也可以使用串联功能
concat
SET @id := '47';SET @table := concat(@id,'_2013_2014_voucher');set @qry1:= concat('select * from ',@table);prepare stmt from @qry1 ;execute stmt ;您也可以针对删除查询执行此操作

在查询中动态表名的使用最好与 Prepared
Staments一起使用 ,在mysql中也可以使用串联功能
concat
SET @id := '47';SET @table := concat(@id,'_2013_2014_voucher');set @qry1:= concat('select * from ',@table);prepare stmt from @qry1 ;execute stmt ;您也可以针对删除查询执行此操作