Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created April 8, 2020 05:52
Show Gist options
  • Save parzibyte/7bc172c6e65ad24192e661980ecfae0d to your computer and use it in GitHub Desktop.
Save parzibyte/7bc172c6e65ad24192e661980ecfae0d to your computer and use it in GitHub Desktop.
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