I have the following tables (just a simplified example):
tblCompany(ID_Company, FK_ID_Code) each company has many codes
tblEmployee(FK_ID_Company, ID_Employee, strName)
tblEmployeeCode(FK_ID_Company, FK_ID_Employee, FK_ID_Code, dblValue) each employee may have many codes, though he may not have all
What I want to generate is:
Name strCode strCode strCode [...] etc
John 12 0 34 [...] etc... if a value doesn't exist, replace by 0
Could someone help me with this, please? I could never get the hang of pivots (probably cause I rarely ever use them).