Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Removing first and last character

Posted on 2012-12-26
3
Medium Priority
?
581 Views
Last Modified: 2012-12-26
Hi All,

I need your assistance. I would like to remove the fist and last characters from 'VHT56789TYHBG'. Can anyone pls help.


Thanks in advance.

select 'VHT56789TYHBG' from dual
0
Comment
Question by:jose11au
3 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 1000 total points
ID: 38722652
SELECT SUBSTR('VHT56789TYHBG', 2, LENGTH('VHT56789TYHBG') - 2) FROM DUAL;

Open in new window

0
 
LVL 74

Assisted Solution

by:sdstuber
sdstuber earned 1000 total points
ID: 38722653
a couple of ways...


select substr(str,2,length(str)-2),
regexp_substr(str,'.(.+).',1,1,null,1)
 from
(select 'VHT56789TYHBG' str from dual )
0
 

Author Comment

by:jose11au
ID: 38722662
Thanks so much.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to recover a database from a user managed backup
Suggested Courses

971 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