|
一个employee table, 有好些重名的人的记录。 比如select * from employee where emp_name = 'ABC' return: emp_id emp_name emp_date 1 ABC 2012 2 ABC 2013 ... 现在我想找出 ‘具有重名性质并且是most recent emp_date' 的记录 这个记录可以是select emp_id from .... 请问这样的查询怎么写? select emp_name, count(*) from employee group by emp_name having count(*)>1 只能按名字分组重名的数量。 emp_name count ABC 2 BCD 2 ... 非常感谢赐教! |