Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #773

Non-Relating Join Criteria

From "Fred." <ghrno-google@yahoo.com>
Newsgroups comp.databases.ms-sqlserver
Subject Non-Relating Join Criteria
Date 2011-11-02 06:53 -0700
Organization http://groups.google.com
Message-ID <12431962.894.1320242027343.JavaMail.geo-discussion-forums@yqbl36> (permalink)

Show all headers | View raw


Transact SQL apparently supports one-sided critera, 
such as the "a.SEL=15" in (1) below. in the join
expression. I would expect that both (1) and (2)
would return the same result set, and the examples
I have tried match this expectation.

My question is whether or not there can be a strong
reason to prefer one over the other, such as impact
on the order of evaluation.

CREATE TABLE a (APK int PRIMARY KEY, SEL int, ... )
CREATE TABLE b (BPK int PRIMARY KEY, AFK int, ... )

(1) SELECT ... FROM a INNER JOIN b 
    ON a.APK=b.AFK AND a.SEL=15

(2) SELECT ... FROM a INNER JOIN b 
    ON a.APK=b.AFK
    WHERE a.SEL=15

Fred.

Back to comp.databases.ms-sqlserver | Previous | NextNext in thread | Find similar


Thread

Non-Relating Join Criteria "Fred." <ghrno-google@yahoo.com> - 2011-11-02 06:53 -0700
  Re: Non-Relating Join Criteria Hugo Kornelis <hugo@perFact.REMOVETHIS.info.INVALID> - 2011-11-02 15:08 +0100
  Re: Non-Relating Join Criteria "Bob Barrows" <reb01501@NOyahooSPAM.com> - 2011-11-02 09:10 -0500

csiph-web