Advertisement

08.05.2008 at 03:48AM PDT, ID: 23621733 | Points: 250
[x]
Attachment Details

How to get a part of string | quicker

Asked by deepak_tyco in Oracle 10.x

Tags: oracle, sql

Hi,
I have a varchar2 column which stores strings like '0974-1000-681000-1000-0000'  or 0974-1000-10000-681000-1000-0000' or '0974-1000-681000-1000'
I need a query which fetches which fetches the first part of it i.e. 0974 which is working fine

The second part of the query should fetch me the 3 or 4 part which will of 6 digits and the number of divisions can be 5 or 6 i meant it can be like 0974-1000-10000-681000-1000-0000' or '0974-1000-681000-1000-0000'

I was able to do this with reqular expression but it is taking long time.

Can any one help me with a query which runs faster

Thanks in advance
Regards,
deepakStart Free Trial
1:
2:
3:
4:
SELECT SUBSTR('0974-1000-681000-1000-0000',1,INSTR('0974-1000-681000-1000-0000','-',1)-1) FROM DUAL
 
 
REGEXP_REPLACE(REGEXP_REPLACE(pdt.GL_EXPENSE, '-[a-zA-Z0-9]+-[a-zA-Z0-9]+$', ''), '[a-zA-Z0-9]+-', '')
[+][-]08.05.2008 at 03:55AM PDT, ID: 22159682

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 03:58AM PDT, ID: 22159701

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 04:33AM PDT, ID: 22159885

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 06:51AM PDT, ID: 22160841

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 06:56AM PDT, ID: 22160885

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 07:00AM PDT, ID: 22160939

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 07:08AM PDT, ID: 22161013

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 07:17AM PDT, ID: 22161101

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 11:17PM PDT, ID: 22167506

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628