Transact-SQL速记联接语法? [英] Transact-SQL shorthand join syntax?

查看:93
本文介绍了Transact-SQL速记联接语法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在处理遗留代码时,我注意到几次,您可以使用

I have noticed a few times when working on legacy code, that you can do left and right outer joins in sql by using the

=*

是正确的外部联接"的简写,并且

as kind of shorthand for "right outer join" and

*=

在以下语句中是左外部连接"的简写形式:

as kind of shorthand for "left outer join" in statements like this:

select table1.firstname, table2.lastname
from table1, table2
where table1.id *= table2.id

我猜想还有其他两个类似的运算符用于不同类型的联接,但是我找不到关于它的任何好的完整文档.那么您知道与文档的任何良好链接吗?

I would guess that there are other operators like these two for the different kinds of joins, but i have not been able to find any good complete documentation about it. So do you know any good links to documentation?

我个人认为,与使用拼写语法相比,使用这些运算符看到的SQL语句更难弄清楚,因此使用速记版本是否有任何好处?

I personaly think that the SQL statements i have seen using these operators are more difficult to figure out than when using the spelled out syntax, so is there any benefits using the shorthand version?

推荐答案

= *和* =在当前的SQL标准中不存在问题,我相信这些运算符将很快被弃用,您应该始终使用标准联接语法.您提到的其他运算符令人困惑,需要删除,当我在数据库对象中看到这些运算符时,我会感到畏缩.

The =* and *= are not complaint with current SQL standards, I believe these operators will be deprecated soon you should always use the standard join syntax. The other operators that you mention are confusing and need to go away, I cringe when I see these in database objects.

这篇关于Transact-SQL速记联接语法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆