Article View: borland.public.vdbase.data.sql
Article #40Re: SQL OUTER JOIN giving unpredictable results
From: Steve Koterski
Date: Mon, 22 Feb 1999 00:00
Date: Mon, 22 Feb 1999 00:00
28 lines
1817 bytes
1817 bytes
On Fri, 19 Feb 1999 19:14:51 -0800, Mark Berry <markb@nospam.mcbsys.com> wrote: [...] >I have an application that is supposed to maintain a 1:1 relation >between two tables, Contact1 and Contact2, based on the AccountNo >field. Sometimes this gets out of whack, and I'm trying to write a >little VDB7 routine to display (and ultimately delete) orphaned >records. The example below looks for Contact1 records with no matching >Contact2. > >The basic question is how to identify orphaned records with SQL. My >RIGHT OUTER JOIN checking a field in the "left-side" table for NULL >doesn't seem to bring back any rows. [...] What version of the BDE are you using? I seem to recall a problem in some earlier version using outer joins *and* filtering to just the non-matching rows like this. Does it work if you juxtapose the two tables and use a LEFT OUTER JOIN? ////////////////////////////////////////////////////////////////////////// Steve Koterski "For people who like peace and quiet: Technical Publications a phoneless cord." INPRISE Corporation -- Unknown http://www.inprise.com/delphi
Technical Details
Message-ID:
<36d799c1.4949355@forums.inprise.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36CE28AB.704C343B@nospam.mcbsys.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff5a1,3dc8d9196f7bc07d X-Google-Attributes: gidff5a1,public From: skoterski@NOSPAMinprise.com (Steve Koterski) Subject: Re: SQL OUTER JOIN giving unpredictable results Date: 1999/02/22 Message-ID: <36d799c1.4949355@forums.inprise.com> X-Deja-AN: 447156864 Content-Transfer-Encoding: 7bit References: <36CE28AB.704C343B@nospam.mcbsys.com> Content-Type: text/plain; charset=us-ascii Organization: INPRISE Corporation, Technical Publications Mime-Version: 1.0 Reply-To: skoterski@NOSPAMinprise.com Newsgroups: borland.public.vdbase.data.sql