1、创建存储过程
BEGIN CREATE TEMPORARY TABLE `tmp_table` ( `name` VARCHAR ( 100 ) NOT NULL , `value` VARCHAR ( 100 ) NOT NULL ); insert into `tmp_table` select `userName` as `name`,`realName` as `value` from `userinfo` where `isDeleted` = 0 limit 10 ; update `tmp_table` set `name` = ' test ' ,`value` = ' 测试数据 ' ; select * from `tmp_table`; drop table `tmp_table`; END
2、执行存储过程
CALL pro_test;