I have the following query which gets as result the language spoken by an employee and his corresponding level :
SELECT E.EmployeeId
,ISNULL(L.ID ,0) AS LanguageId
,L.Label AS Language,
ll.Label AS LanguageLevel
FROM Employee e
LEFT JOIN AF_AdminFile aaf ON e.AdminFileId = aaf.AdminFileId
LEFT JOIN AF_Language al ON aaf.AdminFileId = al.AdminFileId
LEFT JOIN Language l ON al.LanguageId = l.ID
LEFT JOIN LanguageLevel ll ON al.LanguageLevelId = ll.LanguageLevelId
ORDER BY e.EmployeeId
The result is like below :
For the Employee with EmployeeId=6,he speaks English/Fluent, Spanish/Good,French/Mother Tongue.
Knowing that I have 187 different languages in my table Language and 4 language levels in my table LanguageLevel (Fair,Fluent,Good,Mother Tongue)
I want to get only the MotherTongue and the Fluent language like below :
EmployeeId MotherTongue Fluent
6 French English
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…