I have six tables
a. Employee
EmployeeId EmployeeName
123 John
125 Peter
129 Jack
b. EmployeeParameterValue
EmployeeParameterValueId EmployeeId ParameterValueId
1 123 1
2 125 2
3 129 3
c. ParameterValue
ParameterValueId ParameterId Value
1 2 1, 2, 3
2 3 1, 2
3 2 3
d. Parameter
ParameterId Name
2 WorkedStates
3 WorkedType
e. WorkedStates
WorkedStatesId WorkedStatesName
1 CA
2 WA
3 NY
f. WorkedType
WorkedTypeId WorkedTypeName
1 Hourly
2 Salaried
I need to write a report in following format:
EmployeeId EmployeeName Parameter ParameterValue
123 John WorkedStates CA, WA, NY
125 Peter WorkedType Hourly, Salaried
129 Jack WorkedStates NY
I am able to write a query which fetches first 3 columns. But I am not able to write a query which fetches the data in the fourth column.
Please advise.