Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Removing first and last character

Posted on 2012-12-26
3
Medium Priority
?
580 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

670 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