Created
February 23, 2018 20:03
-
-
Save parzibyte/a721fce9689feec3e286098838e2a28a to your computer and use it in GitHub Desktop.
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
SELECT | |
IF( | |
INSTR(nombre, ' ') <> 0, #Condición | |
LEFT(nombre, INSTR(nombre, ' ')), # En caso de que se cumpla, lo cortamos | |
nombre # En caso de que no se cumpla, lo seleccionamos como está | |
) | |
AS primerNombre | |
FROM tblUsuarios; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment