Correlated subqueries

ricky martin
16 de Marzo del 2005
Use the Orders table in the Northwind database to write a correlated subquery that displays the highest EmployeeID associated with each ShipCountry. This means your correlated subquery should display each country name and the employee with the highest EmployeeID. The results should be ordered by country name.

juanin
16 de Marzo del 2005
It seems a stupid exercise to me, but could be because I'm too drunk. So please excuse me and try this (Let me know if this is not what you mean):

select ShipCountry, max(EmployeeID) as Employee from orders
group by ShipCountry
order by ShipCountry

Why would somebody want to know the highest EmployeeID from every ShipCountry. Maybe the EmployeeID of the best seller in every ShipCountry could be most interesting...

Strange people!!