Created
April 8, 2020 05:52
-
-
Save parzibyte/7bc172c6e65ad24192e661980ecfae0d 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
pruebas=# -- Mostramos todos los nombres | |
pruebas=# select * from nombres; | |
nombre | fecha_registro | |
--------+---------------- | |
Luis | 2020-04-03 | |
Maggie | 2020-04-04 | |
Pedro | 2020-04-04 | |
(3 filas) | |
pruebas=# -- Ahora extraemos las primeras 2 letras | |
pruebas=# select substring(nombre, 1, 2) from nombres; | |
substring | |
----------- | |
Lu | |
Ma | |
Pe | |
(3 filas) | |
pruebas=# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment