I have to reverse a number in Sql. I have both PHPmyadmin and Sql management studio, but the following code is not executing. The original code was available here . Thanks
DELIMITER //
CREATE PROCEDURE ggrepeat1()
begin
declare num1 int;
declare num2 int;
declare rev int default 0;
set @num1:='&num1';
while num1>0 do
set @num2:=num1 mod 10;
set @rev:=num2+(rev*10);
set @num1:=floor(num1/10);
end while;
Select 'Reverse number is: 'rev;
end//
DELIMITER ;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…