?
Solved

Get last characters from string

Posted on 2010-03-25
2
Medium Priority
?
4,615 Views
Last Modified: 2012-05-09
How can I get the last two characters from a string in Postgres?
0
Comment
Question by:R7AF
2 Comments
 
LVL 21

Accepted Solution

by:
K V earned 2000 total points
ID: 28542845
TRY:-
substr(STRING, length(STRING)-2, 2)
0
 
LVL 13

Author Comment

by:R7AF
ID: 28544070
Thanks! Apart from a minor change it works!

substr(STRING, length(STRING)-1, 2)
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
In this article, we will show how to detach and attach a database and then show how to repair a corrupt database and attach it, If it has some errors. We will show how to detach and attach using SSMS or using T-SQL sentences.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

599 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question