Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Finding data with spaces in them.
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.
-- Julian Milano "Daniel Morgan" <damorgan_at_x.washington.edu> wrote in message news:1069864672.725596_at_yasure...Received on Wed Nov 26 2003 - 16:50:53 CST
> Prince Of Thieves wrote:
>
> > Problem is....I'm not an Oracle guru. I just know the basic SQL and the
> > following are unknown to me so I hope someone can explain what they do:
> >
> > COUNT (*)>1
> >
> > How does this work?
> >
> > SELECT REPLACE (STYLECODE, ' ','')
> >
> > What does this line do?
> >
> > Thanks.
> >
>
> It would have been really helpful if you had included the actual SQL
> statement instead of making people guess. But since you didn't all you
> get are guesses.
>
> The SQL statement you are working with is in the following format:
>
> SELECT column, COUNT(*)
> FROM sometable
> GROUP BY column
> HAVING COUNT(*) > 1;
>
> Which means don't return rows where the count is less than 2.
>
> The second statement replaces any double spaces it finds ' ' with
> single spaces ' '.
>
> And as Jan suggests ... you need to get a book for starters and explore
> local universities and colleges for a class on SQL.
> --
> 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)
>