首页 新闻 会员 周边

MySql存储过程无法为变量赋值

0
悬赏园豆:5 [已关闭问题] 关闭于 2018-12-09 22:12

select children into childNodes from location_structure limit 1;
SET @phCount = 0;
SET @sqlPhCount = CONCAT('SELECT count(*) INTO @phCount FROM location_photo WHERE LocationID in (',childNodes,')');
PREPARE phCount FROM @sqlPhCount;
EXECUTE phCount;
DEALLOCATE PREPARE phCount;

动态执行这个SQL语句后,@phCount的值仍然是0,使用语句去查询表是有值的。

teagueli的主页 teagueli | 初学一级 | 园豆:75
提问于:2018-12-09 20:05
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册