From ian@SLAC.Stanford.EDU Mon, 11 Jun 2001 15:29:57 -0700 From: "MacGregor, Ian A." Date: Mon, 11 Jun 2001 15:29:57 -0700 Subject: RE: how to substr '%' from the data? Message-ID: MIME-Version: 1.0 Content-Type: text/plain By using the instr function.   Here is an example.  N.B., the  space between the  words "and"  and "seven" is returned.         select substr('Four score and seven years ago',1,   instr('Four score and seven years ago', 'seven') -1)  from dual   SUBSTR('FOURSCO---------------Four score and     Ian MacGregor Stanford Linear Accelerator Center ian@slac.stanford.edu      -----Original Message-----From: Helen rwulfjeq [mailto:lannyue@yahoo.com]Sent: Monday, June 11, 2001 4:07 PMTo: Multiple recipients of list ORACLE-LSubject: how to substr '%' from the data? 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 Personal Address - Get email at your own domain with Yahoo! Mail.