如何选择不同的Career_Name并只显示一次

时间:2014-10-23 14:06:21

标签: mysql sql join

我试图获得这样的输出:

[Career_Name]                     [GroupName]
 Production Career Master          CNC Programmers
                                   Machinists
                                   Machine Operators
                                   Assemblers
                                   Production Helpers

我目前的输出方式如下:

[Career_Name]                     [GroupName]
Production Career Master           CNC Programmers
Production Career Master           Machinists
Production Career Master           Machine Operators
Production Career Master           Assemblers
Production Career Master           Production Helpers

我正在运行这样的查询:

SELECT distinct(Career_Name), `GroupName`
FROM `DOR_Career_Master` DCM, `DOR_Pathway` DP, `DOR_Career_Group` DCG
WHERE
DCM.`DOR_Career_Master_ID`=DP.`DOR_Career_Master_ID`
AND
DCG.`DOR_Career_Group_ID`=DP.`DOR_Career_Group_ID`

有人可以帮忙吗?

谢谢

0 个答案:

没有答案