Sybase ASE 15中左联接和* =之间的区别 [英] Difference between left join and *= in Sybase ASE 15

查看:570
本文介绍了Sybase ASE 15中左联接和* =之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助来了解这件事,下面的两个查询有什么区别,我知道它们不会返回相同的结果.

I need help to understand this matter, what's the difference between the 2 queries below, all I know that they don't return the same result.

查询1:

SELECT a.col1, b.c1
  FROM A a
  LEFT JOIN B b
    ON a.col1 = b.c1
 WHERE b.status = 'Y'

查询2:

SELECT a.col1, b.c1
  FROM A a, B b
 WHERE a.col1 *= b.c1
   AND b.status = 'Y'

推荐答案

抱歉,要晚一点,但是我找到了解决方案:在旧语法*=中,条件b.Status = 'Y'将在左联接中on子句,因此为了在第一个查询中获得相同的结果,我只是将b.Status = 'Y'移到了"on"子句.

Sorry to be a little bit late, but i found the solution: In the old syntax *=, the condition b.Status = 'Y' will be in the left join on clause, so to have to same result in the first query I just moved the b.Status = 'Y' to the "on" clause.

这篇关于Sybase ASE 15中左联接和* =之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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