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: query prob

RE: query prob

From: <Karthik.Mohan_at_gepex.ge.com>
Date: Wed, 04 Jul 2001 22:51:01 -0700
Message-ID: <F001.00341405.20010704224519@fatcity.com>

Try this

for leading spaces :

select name,length(name),rtrim(name)
from ora_test
where length(rtrim(ltrim(name))) != length(rtrim(name));

for lagging spaces :

select name,length(name),ltrim(name)
from ora_test
where length(ltrim(rtrim(name))) != length(ltrim(name));




The Data from the ora_test table is as follows :
NAME                 LENGTH(NAME)
-------------------- ------------
 Karthik Mohan                 15  -- 1 leading space and 1 lagging space
Siva                            6  -- 2 lagging spaces
  God                           5  -- 2 leading spaces

3 rows selected.

Regards,
Karthik Mohan

-----Original Message-----
Sent: Thursday, July 05, 2001 12:10 PM
To: Multiple recipients of list ORACLE-L

hi all

i have one table in which the note column have following entries

ID NOTE



31177340 400A
31177374 FITZGERALD FENCE 31177394 FASHION BUG
31177454 PRECISION LITHOGRAVING
31177472 TOBIN BROS - VACANT
31177497 BRAID MILL
31177514

         GRAIN STORAGE 31177528 EDGEWOOD COMMONS


i want to find the leading as well as trailing spaces in the note field, i am getting the leading spaces using the following query

 select id,NOTE
 from test
 where note like ' %' ;

plz provide me query to get the leading as well as trailing spaces..

thanks in advance

Shirish Khapre, SE Rolta India Ltd.
Off Ph No. (+91) (022) 8326666,8262222,8300568 Ext'n 2730
Minds are like parachutes. They only function when they are open

--

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

Author: Shirish Khapre
  INET: shirish_at_rolta.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).
--

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

Author:
  INET: Karthik.Mohan_at_gepex.ge.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 Thu Jul 05 2001 - 00:51:01 CDT

Original text of this message

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