sql第六题
查找所有员工入职时候的薪水情况
http://www.nowcoder.com/questionTerminal/23142e7a23e4480781a3b978b5e0f33a
第一种方法
select a.emp_no, a.salary from salaries a,employees b
where a.emp_no = b.emp_no and a.from_date=b.hire_date order by b.emp_no desc
第二种
select a.emp_no, a.salary from salaries a,
(
SELECT emp_no,min(from_date) as mindate FROM salaries GROUP BY emp_no
) b where a.emp_no=b.emp_no and a.from_date =b.mindate order by a.emp_no desc