SQL 连接:SQL ANSI 标准的未来(where 与 join)?

我们正在开发 ETL 作业,我们的顾问在连接表时一直使用旧式"SQL

We are developing ETL jobs and our consultant has been using "old style" SQL when joining tables

select a.attr1, b.attr1
from table1 a, table2 b
where a.attr2 = b.attr2

而不是使用内连接子句

select a.attr1, b.attr1
from table1 as a inner join table2 as b
   on a.attr2 = b.attr2

我的问题是,从长远来看,使用旧的where join"是否存在风险?ANSI 标准支持并保留这种连接多长时间?我们的平台是 SQL Server,我的主要原因是将来不再支持这些where joins".发生这种情况时,我们必须使用内连接"样式的连接来修改所有 ETL 作业.

My question is that in the long run, is there a risk for using the old "where join"? How long this kind of joins are supported and kept as ANSI standard? Our platform is SQL Server and my primary cause is that in the future these "where joins" are no longer supported. When this happens, we have to modify all our ETL jobs using "inner join" style of joins.

推荐答案

我怀疑where joins"永远不会得到支持.不支持它们是不可能的,因为它们基于笛卡尔积和简单的过滤.它们实际上不是连接.

I doubt that "where joins" would ever be unsupported. It's just not possible to not support them, because they are based on Cartesian products and simple filtering. They actually aren't joins.

但是使用较新的连接语法有很多原因.其中:

But there are many reasons to use the newer join syntax. Among others:

  • 可读性
  • 可维护性
  • 更容易更改为外连接

相关文章