1
我有一張代表員工及其各種詳細信息的表格。我有另一張表格代表員工參加的培訓課程。一些員工參加了比其他課程更多的課程。我需要在返回的查詢中將每個員工表示爲單個行,並提供相關詳細信息和每個課程的列。動態數據透視表和加入
Employee表:
+--------+---------+---------+----------+ | EmpNum | EmpName | EmpType | EmpPhone | +--------+---------+---------+----------+ | 1234 | Smith | FT | 09876543 | | 2345 | Jones | PT | 08765432 | | 3456 | Brown | FT | 07654321 | +--------+---------+---------+----------+
技能表:
+--------+------------+ | EmpNum | SkillName | +--------+------------+ | 1234 | First Aid | | 2345 | First Aid | | 3456 | First Aid | | 1234 | Safety | | 3456 | Safety | | 1234 | Leadership | | 2345 | Leadership | +--------+------------+
後加盟這2個表,我期待有以下返回:
+--------+---------+---------+----------+-----------+------------+------------+--------+ | EmpNum | EmpName | EmpType | EmpPhone | Skill1 | Skill2 | Skill3 | Skill4 | +--------+---------+---------+----------+-----------+------------+------------+--------+ | 1234 | Smith | FT | 09876543 | First Aid | Safety | Leadership | | | 2345 | Jones | PT | 08765432 | First Aid | Leadership | | | | 3456 | Brown | FT | 07654321 | First Aid | Safety | | | +--------+---------+---------+----------+-----------+------------+------------+--------+
真棒。謝謝。 – Goolsy