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 -> ANSI SQL outer join problem

ANSI SQL outer join problem

From: Krzysztof Ku¶nierz <kkrzysiek_at_supra.com.pl>
Date: Wed, 17 Apr 2002 15:35:03 +0100
Message-ID: <a9jtmo$5b$1@news.tpi.pl>


Hi all,

Here is my situation:

  1. Oracle Database Server 9.0.1 on RedHat Linux 7.2.
  2. The following SQL create example tables:

create table oe1 ( kf integer );
insert into oe1 values(1);
create table oe2 ( kf integer, d date ); insert into oe2 values(1, to_date('2002-02-02','YYYY-MM-DD') ); insert into oe2 values(1, to_date('2002-02-10','YYYY-MM-DD') );

Problem:

SELECT f.kf,g.d
  FROM oe1 f LEFT OUTER JOIN oe2 g ON g.kf=f.kf and to_date('2002-02-05','YYYY-MM-DD')>=g.d

returns 2 rows, while

SELECT f.kf,g.d
  FROM oe1 f LEFT OUTER JOIN oe2 g ON g.kf=f.kf and g.d<=to_date('2002-02-05','YYYY-MM-DD')

returns only one (works properly in my opinion).

Thanks a lot.

Krzysztof Received on Wed Apr 17 2002 - 09:35:03 CDT

Original text of this message

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