I have this query
select s.emp_no, min(s.from_date)
from
**start** (select s.emp_no
from salaries s, employees e
where s.to_date=(select max(to_date) from salaries) and s.emp_no=e.emp_no
group by s.salary DESC
LIMIt 10) **end** as emps, salaries s
where emps.emp_no=s.emp_no
group by s.emp_no;
The start - end part is correct. As you can see it has just one field that contains the employee's number. The emp_no is foreign key to the table salaries. Table salaries has 2 fields. The emp_no and the from_date. Each emp_no may have more than one from_date values. I want to group all the rows of each emp_no from salaries and keep the min from date_value. This shows corrects results (I suppose), but changes the order of the rows created at the start - end part. Any ideas on keeping the order?