时间:2021-07-01 10:21:17 帮助过:3人阅读
DELIMITER $$
DROP FUNCTION IF EXISTS `getOnlyID`$$
CREATE DEFINER=`root`@`%` FUNCTION `getOnlyID`() RETURNS VARCHAR(17) CHARSET utf8
BEGIN
DECLARE x_id VARCHAR(17) DEFAULT ‘‘;
SELECT (CONCAT(‘AC‘,UNIX_TIMESTAMP( CURRENT_TIMESTAMP()),FLOOR(10000 + RAND() * 90000))) INTO x_id;
RETURN x_id;
END$$
DELIMITER ;
MYSQL 随机ID
标签: