Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: how to substr '%' from the data?

RE: how to substr '%' from the data?

From: Nicoll, Iain (Calanais) <iain.nicoll_at_calanais.com>
Date: Mon, 11 Jun 2001 15:20:45 -0700
Message-ID: <F001.00324B8F.20010611152617@fatcity.com>

Not exactly sure what you're after
but possibly the below if you're simply looking to stop before the first occurence of '%'  

select substr('CS-%-ABC-%-%', 1, instr('CS-%-ABC-%-%','%') - 1) from dual;

-----Original Message-----
Sent: 12 June 2001 00:07
To: Multiple recipients of list ORACLE-L

Hello,

I have data like following, how do I substr the string (or use any other function) to get until "%" and return without "%":


RC-SF-DAL-nd-%

AD-LE-%-%-%

RC-DD-LKF-01-RENTAL% CS-%-%-%-%

CS-%-ABC-%-%


I did "select RTRIM('CS-%-%-%-%', '%-%') from DUAL", but it can not return correct for the last record

eg, "select RTRIM(CS-%-ABC-%-%', '%-%') from DUAL" -- will not work correctly  

Thanks for help  


Do You Yahoo!?
Yahoo! Mail <http://personal.mail.yahoo.com/?.refer=mailiyfoot> Personal Address - Get email at your own domain with Yahoo! Mail.

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Nicoll, Iain (Calanais)
  INET: iain.nicoll_at_calanais.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Mon Jun 11 2001 - 17:20:45 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US