参考文章:
https://maoyifa100.iteye.com/blog/1900305
https://www.aliyun.com/jiaocheng/1140825.html
SET @xx="name,bm";
SET @sql1 = CONCAT('select ',@xx,' from people');
prepare s1 from @sql1;
execute s1;
deallocate prepare s1;```
参考文章:
https://maoyifa100.iteye.com/blog/1900305
https://www.aliyun.com/jiaocheng/1140825.html
SET @xx="name,bm";
SET @sql1 = CONCAT('select ',@xx,' from people');
prepare s1 from @sql1;
execute s1;
deallocate prepare s1;```