dongshadu4498 2014-10-28 18:58
浏览 33

列出处理特定项目的所有员工

I am working with a mysql DB called company with Tables:

Employee-> |id_emp|fName|lName|id_Dept|

Department-> |id_Dept|dName|

Project-> |id_Proj|pName|id_Dept|status|budget|actBudget|

Emp_Prof-> |id_Emp|id_Proj|

I am not sure how to run queries that work with the emp_proj join table.

To list all of the employees working on a particular project, I could use this query:

SELECT id_Emp 
FROM emp_proj 
WHERE id_Emp IS NOT NULL;

However, I'd like to output fName and lName from the employee table. I think I need to use a join from Employee and Emp_Prof on id_Emp.

Can anyone help with this type of Query syntax? Thanks...

  • 写回答

4条回答 默认 最新

  • dongyejun1983 2014-10-28 19:03
    关注

    try:

    SELECT Employee.fName, Employee.lName FROM emp_proj, Employee WHERE emp_proj.id_Emp = Employee.id_Emp
    
    评论

报告相同问题?

悬赏问题

  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路