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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Finding data with spaces in them.

Re: Finding data with spaces in them.

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Wed, 26 Nov 2003 16:19:05 -0800
Message-ID: <1069892374.117982@yasure>


Prince Of Thieves wrote:
> Daniel,
>
> Didn't you read my original post:
>
> SELECT STYLECODE, ACTIVE FROM STYLE WHERE REPLACE (STYLECODE, ' ', '')
> IN (SELECT REPLACE (STYLECODE, ' ','')
> FROM STYLE
> GROUP BY REPLACE (STYLECODE, ' ','')
> HAVING COUNT (*)>1);
>
> Sorry!
>
>

>>>The second statement replaces any double spaces it finds '  ' with
>>
>>single spaces ' '.

>
>
> I gathered that, but it returns the following data:
>
> SAT 4346 0
> SAT4346 1
> RIB 1731 1
> RIB1731 1
>
> Which is what intrigued me! It returns the codes with AND without spaces in
> the code! I just want to know how this works.
>
> Thanks for your reply.

Pretty obvious to me. The code converts two spaces to one where it finds them. So what does it do when it finds 10 spaces? Converts them to 5. What does it do when it finds 7 spaces? Converts them to 4: Just do the math.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Wed Nov 26 2003 - 18:19:05 CST

Original text of this message

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