mysql非存储过程动态执行(脱离存储过程可单独执行的动态)

注意分号结束
set @id=1376;
set @sqll=concat("select * from oepp007m where id= ",@id);
set @sql=@sqll;
PREPARE stmt from @sql;
execute stmt;

猜你喜欢

转载自www.cnblogs.com/liyunchuan/p/11670914.html