Solved

Removing first and last character

Posted on 2012-12-26
3
573 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 250 total points
ID: 38722652
SELECT SUBSTR('VHT56789TYHBG', 2, LENGTH('VHT56789TYHBG') - 2) FROM DUAL;

Open in new window

0
 
LVL 73

Assisted Solution

by:sdstuber
sdstuber earned 250 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
select query - oracle 16 92
history tablespace temp usage 2 31
Fastest way to replace data in Oracle 5 50
Oracle 12c database link between pdb not working 20 42
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

912 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now