How to get Master and Slave Table data in one row using SQL Server ?
- by Space Cracker
I have main table called 'Employee' and another slave table called 'EmployeeTypes' that has a FK from 'Employee'.
Each row in 'Employee' can have zero or many rows in 'EmployeeTypes' and I want to make an SQL Query that returns data of all Employees and each employee row should contain its related data in 'EmployeeTypes' (for example column called 'TypeID') as a comma separated list, like this:
Meco Beco --- 45 ---- 1,2,3