-
how find character in string
Hi,
I've table TAB_TEST:
ID............DESC_ID
1.............MY TABLE->YOUR TABLE
2.............DOG->X
6.............MY CATS->YOUR CATS
9.............WINDOWS->Y
7.............MY JOB->YOUR JOB
I'd like to write one query with DESC_ID after character "->"
In my case:
ID............DESC_ID
1.............YOUR TABLE
2.............X
6.............YOUR CATS
9.............Y
7.............YOUR JOB
How can I find the character "->" in DESC_ID and write from that character in then?
Thanks in advance!
-
-
Originally Posted by DaPi
raf, you've been hanging out here since July 2002.
Haven't you learned anything in that time?
Thanks for your help!|
-
Originally Posted by raf
Thanks for your help!|
He didn't really help you.
You need to use instr and substr to get the parts of the string that you want. instr will tell you where in a particular string another string exists, and the substr will grab only the part of the string that you want. You might also look at translate.
DaPi is right, this is pretty basic stuff.
-
I was rather hoping that raf might have learned at least where the manuals are by now . . . . .
"The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman
-
Originally Posted by DaPi
raf, you've been hanging out here since July 2002.
Haven't you learned anything in that time?
Unfortunately there are quite a few like raf in this forum (or even from 2000, 2001!)
-
Originally Posted by gandolf989
He didn't really help you.
You need to use instr and substr to get the parts of the string that you want. instr will tell you where in a particular string another string exists, and the substr will grab only the part of the string that you want. You might also look at translate.
DaPi is right, this is pretty basic stuff.
select id, substr(desc_id,instr(desc_id,'->')+2)
from TAB_TEST;
THANKS TO ALL!
-
Originally Posted by raf
select id, substr(desc_id,instr(desc_id,'->')+2)
from TAB_TEST;
THANKS TO ALL!
Your welcome.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|