Skip to content

Instantly share code, notes, and snippets.

@horaciod
Last active April 20, 2023 23:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save horaciod/b269b070fa77935c34fc0953aa29e376 to your computer and use it in GitHub Desktop.
Save horaciod/b269b070fa77935c34fc0953aa29e376 to your computer and use it in GitHub Desktop.
postgresql-funciones-string
-- Teniendo una columna activida con el texto
-- Se ha validado la tapa de OLESID060417 con el archivo https://bibliotecas.uncuyo.edu.ar/sig/catalogo/editor/tapa/tapaurl.
-- se puede obtener solo el código con la siguiente sql
select substring (actividad, length('Se ha validado la tapa de '),
position(' ' in replace(actividad, 'Se ha validado la tapa de ',
''))),
actividad
from "logueo"
where actividad like 'Se ha validado la tapa de%'
order by "idlogueo" desc
limit 50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment