mysql - SELECT latest date in a group of results distinctly -
i have query (i show below) generating following result set (this goes on 53,000 more records) +--------+---------+--------+--------+------------+------------+ | emp_no | counter | emp_no | salary | from_date | to_date | +--------+---------+--------+--------+------------+------------+ | 10001 | 1 | 10001 | 60117 | 1986-06-26 | 1987-06-26 | | 10001 | 1 | 10001 | 62102 | 1987-06-26 | 1988-06-25 | | 10001 | 1 | 10001 | 66074 | 1988-06-25 | 1989-06-25 | | 10001 | 1 | 10001 | 84917 | 1999-06-23 | 2000-06-22 | | 10001 | 1 | 10001 | 85112 | 2000-06-22 | 2001-06-22 | | 10001 | 1 | 10001 | 85097 | 2001-06-22 | 2002-06-22 | | 10001 | 1 | 10001 | 88958 | 2002-06-22 | 9999-01-01 | | 10002 | 2 | 10002 | 65828 | 1996-08-03 | 1997-08-03 | | 10002 | 2 | 10002 | 65909 | 1997-08-03 | 1998-08-03 | | 10002 | 2 | 10002 | 67534 | 1998-08-03 | 1999-08-03 | | 10002 | 2 | 10002 | 69366 | 1999-08-03 | 20...