1. 分析
- 考察联接
- 注意结果中列的顺序,dept_no在后边
- 使用AS将表名写成别名缩短语句
2. 代码
SELECT s.*, d.dept_no FROM salaries AS s , dept_manager AS d WHERE s.to_date='9999-01-01' AND d.to_date='9999-01-01' AND s.emp_no=d.emp_no;
SELECT s.*, d.dept_no FROM salaries AS s , dept_manager AS d WHERE s.to_date='9999-01-01' AND d.to_date='9999-01-01' AND s.emp_no=d.emp_no;