I've got a table Employees with employees (say the important fields are ID int, Name varchar(50)) and a table Areas with sales areas (ID int, EmployeeID int, USState char(2)).
The sample values are:
Employees
ID Name
1 Shoeman
2 Smith
3 Johnson
Areas
ID EmployeeID USState
1 1 NY
2 1 FL
3 1 AR
4 2 DC
5 2 AR
6 3 TX
Can anyone give me a hint on making a SQL query to get the output recordset in the following way:
EmployeeID USState
1 NY FL AR
2 DC AR
3 TX
Target platform: SQL Server 2005.