有人可以看看我的代码吗,因为我不知道它在 MySQL 中是否可以
set @max=concat('select max(length(CommentsId))from', table_name);
prepare stmt from @max;
execute stmt;
set @max=concat('UPDATE', table_name, 'SET CommentsId= ',CommentsId * power(10, (@max - length(CommentsId))),' WHERE CommentsId= ', @CommentsId );
prepare stmt from @max;
execute stmt;