Received: from mail.utexas.edu (wb2-a.mail.utexas.edu [128.83.126.136]) by hub.org (8.8.8/8.8.8) with SMTP id NAA13907 for ; Sat, 17 Oct 1998 13:44:36 -0400 (EDT) (envelope-from taral@mail.utexas.edu) Received: (qmail 14510 invoked by uid 0); 17 Oct 1998 17:44:34 -0000 Received: from dial-41-16.ots.utexas.edu (HELO taral) (128.83.111.208) by umbs-smtp-2 with SMTP; 17 Oct 1998 17:44:34 -0000 From: "Taral" To: , "PgSQL-sql" Cc: Subject: RE: [SQL] Is this BUG or FEATURE? Date: Sat, 17 Oct 1998 12:44:33 -0500 Message-ID: <000001bdf9f5$cccafa00$3b291f0a@taral> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 > create table AAA (anum int2, aname char(16), ata int4 default 0); > insert into AAA values (0, '0'); > insert into AAA values (1, '1'); > -- Note: ata hasn't initialized! Yes it has. ata = 0 in both because you set a default. > test=> select * from aaa, bbb where bnum = ata; > NOTICE: ExecInitMergeJoin: left and right sortop's are unequal! > anum| aname|ata|bnum| bname > ----+----------------+---+----+---------------- > 0|0 | 0| 0|0 > 1|1 | 0| 0|0 > (2 rows) You asked for all cases where bnum = ata. I assume select * from aaa,bbb; would have returned: anum| aname|ata|bnum| bname ----+----------------+---+----+---------------- 0|0 | 0| 0|0 0|0 | 0| 1|1 1|1 | 0| 0|0 1|1 | 0| 1|1 Now filter for bnum=ata and you get two rows. Am I wrong here? Taral