Hi, I was given a tricky challenge question to attempt and allowed the use of any resources at my disposal. So far all my attempts have produced results close to the expected output but not quiet the expected out put. Here's the link to the question: Question and here's where you can test your query: test here. Here's my query that produced the closest results:
SELECT DISTINCT Competencies.CompName AS compname, Users.FirstName AS firstname, Users.SurName AS surname, CompPos.Level AS positionlevel, CompUser.Level AS userlevel
FROM Positions INNER JOIN CompPos
ON Positions.PosId = CompPos.PosID
INNER JOIN Competencies
ON CompPos.CompID = Competencies.CompID
INNER JOIN CompUser
ON Competencies.CompID = CompUser.CompID
CROSS JOIN Users
WHERE (Users.UserId IN ('999209', 'helpdesk1', '999339', 'helpdesk5', '999827'))
AND (CompUser.UserID IN ('999209', 'helpdesk1', '999339', 'helpdesk5', '999827'))
AND (Positions.Position LIKE '%Corp HR-People Development-Wellness-Manager(Process)%')
ORDER BY CompPos.Level DESC, Competencies.CompName, CompUser.Level, Users.FirstName, Users.SurName