mysql 函数 存储过程 互调用

getrand()

BEGIN
RETURN (SELECT (FLOOR(RAND()*64)) from cs_admin);
END

函数 返回随机数

getinfoimg()

BEGIN
set @y=getrand();
SELECT info_imgpath_icon from cs_temp where info_id=@y into @x;

RETURN (@x);
END

函数 返回cs_temp  中 info_imgpath字段的getrand()随机数的图片地址

BEGIN
set @y=getrand();
SELECT info_imgpath_icon from cs_info where info_id=@y into @x;
select @x;


END

存储过程 img

猜你喜欢

转载自www.cnblogs.com/hackermi/p/9169189.html