Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL help on how to extract chars from a string?
<yliu_at_creighton.edu> writes:
Hi!
I think this will do the job:
select substr(a, instr(a, '"')+1,
instr(a, '"',1,2 ) - instr(a, '"')-1) from yourtable;
I wonder if there's more beautiful solution :)
>Hi All,
>I need some help on how to use SQL to extract names from a string. My
>strings all look like the following string:
> name changed from "Yongge Liu" on date...
>The strings are 60 chars long. The names are variable length (I don't
>have any ideas how long the name is), but they are enclosed in quote (e.g.
>"Yongge Liu" in this example). I know the starting point of the name, but
>I do not know the ending position (I do know they are always ended with a
>double quote). I already checked out substr function, I don't think the
>substr function can do the job in my case. Can I write up some PL/SQL
>function to do this?
>Thank you so kindly in advance.
>Best regards
>Yongge
>yliu_at_creighton.edu
--
TK
Received on Tue Feb 09 1999 - 11:01:36 CST
![]() |
![]() |