set @x ='testX';
set @b='"AA"';
set @sqll= concat('select * from ',@x,' where name =',@b);
prepare stmt from @sqll;
EXECUTE stmt
动态sql跟where条件时,记得加两个引号
猜你喜欢
转载自www.cnblogs.com/liyunchuan/p/12632301.html
今日推荐
周排行