Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Finding data with spaces in them.
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 yieldsSAT4346
(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
![]() |
![]() |