Last active
November 27, 2018 14:34
-
-
Save alexruzenhack/0d3bd7e72fae2f45c61c213593c68db3 to your computer and use it in GitHub Desktop.
Query para criar uma função de extrair string do primeiro nome de string de nome completo no #mysql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE DEFINER=`ruzenhack`@`%` FUNCTION `first_name`(name varchar(100)) RETURNS varchar(100) CHARSET utf8 | |
BEGIN | |
declare firstName varchar(100); | |
SET firstName = ucase(substring_index(name, ' ', 1)); | |
RETURN firstName; | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment