Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Join Order Bug?
Buck ,
I saw this problem a couple of years ago. I think if you put double quotes
around the
E.CALENDER_YEAR it goes away as well. Not that this is really a workable
solution.
-rc-
"Buck Turgidson" <jc_va_at_hotmail.com> wrote in message
news:18c358a974081fa6d35efdcebc8fb02a.38849_at_mygate.mailgate.org...
> Can anyone help me understand why the first query does not return any
> rows, but by moving a line in the where clause, it then returns the rows
> I need?
>
> SQL> select version from v$instance;
>
> VERSION
> -----------------
> 8.1.6.0.0
>
> SQL> SELECT COUNT(*)
> 2 FROM PS_YE_DATA E ,PS_W2_COMPANY W
> 3 WHERE E.COMPANY = 'A24'
> 4 AND W.CALENDAR_YEAR = E.CALENDAR_YEAR
> 5 AND W.CALENDAR_YEAR = 2001
> 6 AND E.TAXFORM_ID = 'W'
> 7 AND W.COMPANY = E.COMPANY;
>
> COUNT(*)
> ----------
> 0
> SQL>
> SQL> SELECT COUNT(*)
> 2 FROM PS_YE_DATA E,PS_W2_COMPANY W
> 3 WHERE E.COMPANY = 'A24'
> 4 AND W.CALENDAR_YEAR = 2001
> 5 AND W.CALENDAR_YEAR = E.CALENDAR_YEAR -- switched position
> 6 AND E.TAXFORM_ID = 'W'
> 7 AND W.COMPANY = E.COMPANY;
>
> COUNT(*)
> ----------
> 4779
>
>
> --
> Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
Received on Tue Feb 26 2002 - 21:49:41 CST