Question: Substring from an escape character onwards

Question

Substring from an escape character onwards

Answers 2
Added at 2016-12-21 15:12
Tags
Question

I'm using PostgreSQL and I need to truncate a text string, I need to show from an escape character (:) onwards.

I'm trying something like that:

  SELECT SUBSTRING ('CATEGORIA DE TRABAJOS: EJECUTIVO' FROM '%#":#"%' FOR '#'); 
Answers to

Substring from an escape character onwards

nr: #1 dodano: 2016-12-21 15:12
t=# select split_part('CATEGORIA DE TRABAJOS: EJECUTIVO',':',2);
 split_part
------------
  EJECUTIVO
(1 row)

just split by first found delimiter?..

nr: #2 dodano: 2016-12-21 16:12

Resolved thanks to the help of Vao Tsun.

Source Show
◀ Wstecz