如何在SQL中使用JOIN语句
我正在研究一个具有两个表格的员工_DATA数据集;员工和部门。我正在尝试使用Department_ID作为主要密钥加入员工表的数据到部门表。它不断给我一个错误消息。请我在哪里想念它?
SELECT name AS departments_name,
(
SELECT name AS employees_name,
FROM `my-first-analysis.employee_data.employees`
)
FROM `my-first-analysis.employee_data.departments`
JOIN departments ON departments.department_id = employees.department_id
I'm working on an employee_data dataset which has two tables; employees and departments. I'm trying to join data from the employee table to the departments table using department_id as the primary key. It keeps giving me an error message. Please where am I missing it?
SELECT name AS departments_name,
(
SELECT name AS employees_name,
FROM `my-first-analysis.employee_data.employees`
)
FROM `my-first-analysis.employee_data.departments`
JOIN departments ON departments.department_id = employees.department_id
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
像这样:
Like this: