D
D
des1roer2016-09-28 09:28:51
PostgreSQL
des1roer, 2016-09-28 09:28:51

Postgres trim string from end?

How to take the last 10 characters from a string?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
des1roer, 2016-09-28
@des1roer

select substring ( 'yyyyyyyyyyyyy' from length ('yyyyyyyyyyyyy') - 10 )

S
Sergey Gornostaev, 2016-09-28
@sergey-gornostaev

select 
  substring(fieldname, char_length(fieldname) - 10)
from tablename;

G
gaparchi, 2017-12-23
@gaparchi

SELECT right(fieldname, 10) FROM tablename;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question