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: Hans Forbrich <forbrich_at_badaddress.net>
Date: Wed, 26 Nov 2003 23:27:36 GMT
Message-ID: <3FC536F8.94402B2F@badaddress.net>


Prince Of Thieves wrote:
>
>
> 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.
>

Sticking with SAT 4346 and SAT4346

SELECT STYLECODE ... . in other words, 'print' a line for SAT 4346 . and print a separate line for SAT4346

WHERE REPLACE(STYLECODE, ' ', '') IN ...

. selection criteria is
. Stylecode = SAT 4346, replacing spaces with nothing yields SAT4346
. Stylecode = SAT4346,  replacing spaces with nothing ALSO yields
SAT4346
. finding when these match the list (IN)

(SELECT REPLACE(STYLECODE, ' ', '') ... . the list is made of both SAT 4346 and SAT4346, but with any spaces removed

FROM STYLE ... . from this table

GROUP BY REPLACE (STYLECODE, ' ','') ordering by and 'clumping together' (stylecodes with the spaces removed)

HAVING COUNT (*)>1); and only keeping those 'clumps' which have more than one row

PLEASE spend some time learning basic SQL! Received on Wed Nov 26 2003 - 17:27:36 CST

Original text of this message

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