【发布时间】:2022-09-27 16:18:04
【问题描述】:
所以对于一个任务,我需要查找支持来自加拿大的客户的员工的经理来自chinook data base
现在我有以下代码:
select distinct employee.LastName, employee.EmployeeId, employee.ReportsTo
from customer,
employee
where customer.Country = \'Canada\'
and customer.SupportRepId = employee.EmployeeId;
所以我需要获取EmployeeId为2的总经理的姓名,但我不知道如何将其放入一个查询中。
-
您可能会惊讶有多少问题被忽略了,因为它们不是自包含的,并期望我们追踪链接。继续。
-
我可以看到
customer桌子吗? -
不要在 where 语句中使用旧的连接表变体。使用
join关键字 -
@Jens 同意
-
还将示例数据显示为预期结果以及作为文本而不是链接获得的结果