SQL Joins: Future of the SQL ANSI Standard (where vs join)?(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:
- 可读性
- 可维护性
- 更容易更改为外连接
这篇关于SQL 连接:SQL ANSI 标准的未来(where 与 join)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:SQL 连接:SQL ANSI 标准的未来(where 与 join)?
基础教程推荐
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- oracle区分大小写的原因? 2021-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- 在多列上分布任意行 2021-01-01
