-1
有人可以看看我的代碼,因爲我不知道它在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;
你想幹什麼?它在運行時有什麼作用?這些事情有什麼不同? – geoffspear 2012-08-02 12:21:28
只是在這裏提出一個建議,但知道是否可以或不可以的最好方法就是試用它。 – Tchoupi 2012-08-02 12:42:08