Article View: borland.public.interbase.sql
Article #11030Re: Join on Interbase
From: Bill Todd
Date: Fri, 27 Dec 2002 01:56
Date: Fri, 27 Dec 2002 01:56
43 lines
2069 bytes
2069 bytes
On Fri, 27 Dec 2002 01:05:28 +0100, "The DeerBear" <rainaple@tin.it> wrote: >Dan Palley wrote: >> Basically, you're combining values from two tables (ACCOUNTS and >> ROLES) into a single result set. The relationship between the two >> tables is based on user_id. Since you're doing a left join, records >> in ACCOUNTS with no corresponding ROLES records will still be >> included in the result set. > >Ok, so how would I make it return _only_ all records which have a >corresponding >USER_ID in the ROLES table? Change LEFT OUTER JOIN to JOIN What you are asking for is an inner join and that is the default. > >> The Interbase Data Definition Guide goes into great detail on the >> syntax of the JOIN statement. > >Oh, ok, I'll look there. > >>Since Interbase syntax is fairly >> vanilla SQL-92, most SQL books are applicable as well (I recommend >> SQL for Smarties by Joe Celko). > >I have it :)))) > >Thanx a lot > >> Dan > >Andrew > -- Bill (TeamB) (TeamB cannot respond to questions received via email)
Technical Details
Message-ID:
<8pcn0v45erefnhm4r5klu829q6u82fkosi@4ax.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.news2me.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3e0b8c13@newsgroups.borland.com> <3e0b9474$1@newsgroups.borland.com> <3e0b9941@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 114a0e,fa51700038f7b6f2 X-Google-Attributes: gid114a0e,public X-Google-ArrivalTime: 2002-12-26 18:03:22 PST From: Bill Todd <bill@notthis.dbginc.com> Newsgroups: borland.public.interbase.sql Subject: Re: Join on Interbase Date: Thu, 26 Dec 2002 18:56:41 -0700 Message-ID: <8pcn0v45erefnhm4r5klu829q6u82fkosi@4ax.com> References: <3e0b8c13@newsgroups.borland.com> <3e0b9474$1@newsgroups.borland.com> <3e0b9941@newsgroups.borland.com> X-Newsreader: Forte Agent 1.91/32.564 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 216.207.211.57 X-Trace: newsgroups.borland.com 1040954217 216.207.211.57 (26 Dec 2002 17:56:57 -0800) Lines: 43 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.news2me.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail