sql - 如何将 SQL 中的当前 QUERY 转换为不同的数据
问题描述
我正在尝试在 SQL 中使用此 QUERY
select homework
from karlos
except
select k_id
from yara
where y_ID is not null;
更新:基本上我只想将最上面的查询重写为另一个输出相同结果但使用没有子查询或集合操作的外连接的查询
解决方案
我想你想要not exists
:
select s.ID
from student
where not exists (select 1
from advisor a
where a.s_id = s.id and a.i_id is not null
);
推荐阅读
- powershell - 用于从 FTP 自动下载文件的脚本
- php - 不能在中间件中使用 laravel 单例
- python - 将字典条目转换为配置文件中的变量
- php - Cakephp:mpdf 将生成的 pdf 存储在禁止目录中
- uwp - 在哪里可以找到用于应用到应用通信的 UWP 应用文档?
- image - 使用 tf.browser.fromPixels 和 Tensorflow JS 创建多个图像的张量
- ios - iOS:子视图控制器解除导致再次调用 viewDidLoad
- asp.net-core - 了解 Microsoft 标识命名空间(System.Web.Security、Microsoft.AspNet.Identity.Core 与 Microsoft.AspNetCore.Identity)
- r - 在 lapply 语句中访问 .SD 属性
- c - 如何在 SAP b1 表单中创建列树视图?