WHERE限定
获取所有部门当前manager的当前薪水情况,给出dept_no, emp_no以及salary,当前表示to_date=9999-01-01
http://www.nowcoder.com/questionTerminal/4c8b4a10ca5b44189e411107e1d8bec1
可以直接使用WHERE限定语句
SELECT d.dept_no, d.emp_no, s.salary
FROM dept_manager AS d, salaries AS s
WHERE d.emp_no = s.emp_no
AND d.to_date = s.to_date
AND d.to_date = '9999-01-01'也可以使用 INNER JOIN
SELECT d.dept_no, d.emp_no, s.salary
FROM dept_manager AS d INNER JOIN salaries as s
ON d.emp_no = s.emp_no
AND d.to_date = s.to_date
AND d.to_date = '9999-01-01'