79377157

Date: 2025-01-22 09:34:08
Score: 1
Natty:
Report link
DECLARE v_result, v_word VARCHAR(2000) DEFAULT '';
FOR i IN 1..length(p_string) + 1 - length(replace(p_string, ' ', '')) -- word count
DO
    SET v_word = ifnull(SUBSTRING_INDEX(SUBSTRING_INDEX(p_string, ' ', i), ' ', -1), '');
    SET v_result = CONCAT(v_result, ' ', UPPER(SUBSTR(v_word, 1, 1)), LOWER(SUBSTR(v_word, 2)));
END FOR;

RETURN v_result;
Reasons:
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Hugues Sauzier