Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Join Order Bug?

Re: Join Order Bug?

From: rcman <relational_comp_at_yahoo.com>
Date: Tue, 26 Feb 2002 22:49:41 -0500
Message-ID: <u7olmemuet4198@corp.supernews.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US