oracle SQL Query中的表连接

ifmq2ha2  于 2023-04-20  发布在  Oracle
关注(0)|答案(1)|浏览(136)

我在Oracle DB中有三个表,如下所示:
培训_日历_hdr

-----------------------------
Training_Id     Training_Name
-----------------------------
T1               Physics
T2               Chemistry
T3               Maths

培训_员工_Map

---------------------------
Training_Id   Employee_Id
---------------------------
T1               E001
T1               E003
T1               E007
T3               E001
T3               E010
T3               E008
T3               E011

员工_详细信息

---------------------------
Employee_Id    Designation
---------------------------
E001        Engineer
E002        Professor
E003        Businessman
E004        Engineer
E005        Govt. Service
E006        Unemployed
E007        Engineer
E008        Govt. Service
E009        Professor
E010        Unemployed
E011        Professor

我需要连接三个表的结果,如下所示:

--------------------------------------------------------------------------------
    Training_Name   Engineer    Businessman   Unemployed    Professor   Govt. Service
    --------------------------------------------------------------------------------
    Physics           2            1                                     

    Maths             1                        1           1            1

相关问题