curr-yyyymmdd-func.sql 222 B

123456789101112
  1. DELIMITER $$
  2. CREATE DEFINER=`root`@`localhost` FUNCTION `CurrYyyymmdd`() RETURNS varchar(8) CHARSET utf8mb4
  3. BEGIN
  4. DECLARE ret VARCHAR(8);
  5. set ret = DATE_FORMAT(CURDATE(), "%Y%m%d");
  6. RETURN ret;
  7. END$$
  8. DELIMITER ;