Einzelnen Beitrag anzeigen

Dax
(Gast)

n/a Beiträge
 
#4

Re: GROUP BY nach ORDER BY?

  Alt 21. Feb 2009, 17:30
Ich würde vermuten, dass es auch ohne Subqueries im Where geht:
SQL-Code:
SELECT ee.nickname, eed.*
FROM employees_employees ee
     JOIN employees_employee_data eed ON (ee.id = eed.emp_id)
     JOIN (SELECT eed2.emp_id AS emp_id, MAX(eed2.start_date) as start_date
           FROM employees_employee_data eed2
           GROUP BY emp_id, start_date) limits ON (ee.id = limits.emp_id AND eed.start_date = limits.start_date)
ORDER BY ee.nickname, eed.start_date
  Mit Zitat antworten Zitat