如何写"not in()"?使用联接的SQL查询 [英] How to write "not in ()" sql query using join

查看:172
本文介绍了如何写"not in()"?使用联接的SQL查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请提供一些如何使用联接编写以下sql查询的方法.我不希望使用 not in ,也不要在可能的情况下也替换 where 条件.

Could some one please provide how to write following sql query using joins. I do not want use not in as well as if possible I would like to replace where condition as well.

SELECT d1.Short_Code
FROM domain1 d1
WHERE d1.Short_Code NOT IN (
  SELECT d2.Short_Code
  FROM Domain2 d2
)

我正在使用SQL Server 2008

I am using SQL Server 2008

推荐答案

本文:

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