Re: SQL-92 Compliant

From: Les Gainous <lesgainous_at_earthlink.net>
Date: 1996/10/27
Message-ID: <32744F88.2BC1_at_earthlink.net>#1/1


Jim Smith wrote:

> <...snip>
>"table1 JOIN table2 ON" is just an alternative (and IMO less readable)
>way of saying "table1, table2 where "
> <snip...>

I disagree. It is not less readable. It explains the logic clearly! It also minimizes the risk of writing bad code and producing run-away queries. For instance, we have folks (myself included) that will get so involved with the filters ("where" clause) that they omit the join columns by mistake and then the "cross join" (or cartisian product) is set off in action. Let's take a look:

select	col1,
	col2
from	table1 t1,
	table2 t2
where   t1.name = 'Fred' and
	t1.color = 'red' and
	t1.cost <= 1.99 and
	t2.anynumber = 3 and
	t2.anothernumber >= 175

Some of our tables are 3+ million rows and if the above query get started...watch out! On the surface, the query looks good, but there is no link (join) between the two tables. When we the Microsoft SQL Server (and the SQL-92 syntax for the) INNER JOIN statement, leaving out the joining columns would produce an error and the query would fail to run--which is what we would like to happen.

good.luck = true

-- 
 Les Gainous, lesgainous_at_earthlink.net

 Visit my web page at
      http://home.earthlink.net/~lesgainous

 Looking for a Client-Server job in California?
      http://home.earthlink.net/~lesgainous/jobs.html
Received on Sun Oct 27 1996 - 00:00:00 CEST

Original text of this message