Subquery not returning correct results
Posted in 1999
I have an SQL statement that does a subquery that returns a count of 0
when it should return a count of 200000+. The statement looks like
this:
select count(*) from myTable
where col1 || col2 || col3 || col4 || col5 not in
(select col1 || col2 || col3 || col4 || col5 from myOtherTable);
The above statement returns a count of 0 when it should return a count
of 200000+. If I change the "not in" to "in" in the statement, I get a
count of 33000 returned. myTable has over 200000 rows. myOtherTable
has 5500 rows. If I remove a few hundred rows from myOtherTable, I
then get the expected count of 200000+.
This looks like a bug. Is there a work around that anyone knows of?
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.