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:
>
>
> SELECT STYLECODE, ACTIVE FROM STYLE WHERE REPLACE (STYLECODE, ' ', '')
> IN (SELECT REPLACE (STYLECODE, ' ','')
> FROM STYLE
> GROUP BY REPLACE (STYLECODE, ' ','')
> HAVING COUNT (*)>1);
>
You might find that a bit of prettyprint formatting could help you understand the code.
Try this
SELECT STYLECODE, ACTIVE
FROM STYLE
WHERE REPLACE (STYLECODE, ' ', '')
IN (SELECT REPLACE (STYLECODE, ' ','') FROM STYLE GROUP BY REPLACE (STYLECODE, ' ','') HAVING COUNT (*)>1)
Analyze the subselect first, understand what it does, and - if necessary look up the IN operator. Received on Thu Nov 20 2003 - 20:42:24 CST