A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
substr in oracle
Joined: Aug 19, 2008
Feb 26, 2011 19:07:39
Can anyone please help to extract yahoo from above
Joined: Sep 01, 2005
Feb 28, 2011 10:29:09
You can use a combination of substr and instr. Something like this.
select substr('email@example.com',instr('firstname.lastname@example.org','@')+1,instr('email@example.com','.')-instr('firstname.lastname@example.org','@')-1) from dual
But you may need to improve to handle repeating '.'
Joined: Nov 24, 2005
Mar 01, 2011 17:40:33
Note that Oracle supports regular expressions (REGEXP_LIKE), so if you can come up with a regular expression to extract that part, you'll probably be able to use it with Oracle.
All roads lead to JavaRanch
subject: substr in oracle
SCJP 1.5 review - not a so good test?
design the Java swing with dynamic creation of JTextfield,JLabel,Jcombobox
NX: Reading from the DB
TOMCAT Environmental Variables
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015