🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #538

loss record for join not found

#538
From: Adalberto Baldini
Date: Tue, 20 Nov 2007 14:45
38 lines
2068 bytes
I have table FIOPEDOC with these records :

OPE    DOC_1    DOC_2
001              FTS     (DOC_1 = ''   it is not null)
058              FTA
071    CGE       CGA
071    FTA       CGA

I have this view :

CREATE VIEW OPE_DOC_VIEW_CPY(
    CODOPE,  TIPDOC_1, TIPDOC_2, CODDOC_1, DES60)
AS
select a.codope, a.doc_1 , a.doc_2 , b1.coddoc, a1.des60
from fiopedoc a
left join fitipdoc a1 on (a.doc_1 = a1.coddoc)
      join coddoc   b1 on (a.doc_1 = b1.tipdoc );

I get record only for OPE = 071 and miss those which has DOC_1 = '' :

CODOPE TIPDOC_1 TIPDOC_2 CODDOC_1   DES60
071     CGE      CGA       CGE      jkhkj
071     FTA      CGA       FAA      jkjkl
071     FTA      CGA       FTA      hjkhkj    ...

With Left Join I expect to receive all records from table FIOPEDOC , 
completed with data retrieved from joined table like :

CODOPE TIPDOC_1 TIPDOC_2 CODDOC_1
001              FTS
058              FTA
071     CGE      CGA       CGE
071     FTA      CGA       FAA
071     FTA      CGA       FTA ...

why I miss first 2 records ?

Adalberto Baldini
Technical Details
Message-ID: <4742f309$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,694ee342bc441d0c,start
X-Google-Attributes: gid114a0e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Tue, 20 Nov 2007 15:45:36 +0100
From: Adalberto Baldini <finman@swissonline.ch>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.interbase.sql
Subject: loss record for join not found
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 80.183.140.110
Message-ID: <4742f309$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1195569929 80.183.140.110 (20 Nov 2007 06:45:29 -0700)
Lines: 38
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail