Re: Joins over the equality sign
From: Tibor Karaszi (tibor_please.no.email_karaszi_at_hotmail.nomail.com)
Date: 04/01/04
- Next message: Bob: "SQL script help"
- Previous message: Aaron Bertrand [MVP]: "Re: Find the first available integer."
- In reply to: Adam Machanic: "Re: Joins over the equality sign"
- Next in thread: Joe Celko: "Re: Joins over the equality sign"
- Reply: Joe Celko: "Re: Joins over the equality sign"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 1 Apr 2004 19:39:08 +0200
What I'm (trying :-) ) to say is: Consider below::
SELECT ...
FROM tbl1, tbl2
WHERE tbl1.col = tbl2.col
Logically the FROM clause is processed first. This gives us a Cartesian product, right? After that you filter
away a number of rows in the WHERE clause. This is, used correctly, what we usually refer to as a "join". I
fail to see how above syntax can be removed from the SQL language,. quire simply.
I agree that if you *want* a Cartesian product, then use the new syntax and CROSS JOIN. I'm just reasoning
that it would be difficult to disallow the old syntax. Unless you remove to specify more than one table in the
FROM clause (without using JOIN), but I guess that this would be a too deep change to do for both ANSI and MS.
-- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp "Adam Machanic" <amachanic@air-worldwide.nospamallowed.com> wrote in message news:eD2a4SAGEHA.2052@TK2MSFTNGP11.phx.gbl... > "Tibor Karaszi" <tibor_please.no.email_karaszi@hotmail.nomail.com> wrote in > message news:OZj1xMAGEHA.3984@TK2MSFTNGP10.phx.gbl... > > The old-style inner join syntax will not be removed from ANSI or SQL, as > there is nothing to prevent us from > > doing a Cartesian product and then a restriction (which is what the old > style really does, logically). > > I'm not sure I understand what you mean; doesn't CROSS JOIN provide us > with that capability? > >
- Next message: Bob: "SQL script help"
- Previous message: Aaron Bertrand [MVP]: "Re: Find the first available integer."
- In reply to: Adam Machanic: "Re: Joins over the equality sign"
- Next in thread: Joe Celko: "Re: Joins over the equality sign"
- Reply: Joe Celko: "Re: Joins over the equality sign"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|