SELECT LPAD(n, m, 0);==>n前面补m-n个0
SELECT RPAD(n, m, 0);==>n后面补m-n个0
随机数
DELIMITER //
CREATE FUNCTION rand_num (
start_num INTEGER,
end_num INTEGER
) RETURNS INTEGER
BEGIN
RETURN FLOOR(start_num + RAND() * (end_num - start_num + 1));
END
//
DELIMITER ;
SELECT rand_num(1,10000);
concat(str1,str2,str3);==>连接字符串
时间: 2024-10-09 22:02:16