Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Fixed your query:</p> <pre><code>SELECT p.ProblemID, p.CustomerID, p.Summary, p.DateLogged, p.DateUpdated, s.Status, pr.Priority, t.Name, t.Surname, sg.* , ho.Name AS Expr1, ho.Surname AS Expr2, p.NoteID, p.ResolutionID FROM Problem p INNER JOIN Status s ON p.StatusID = s.StatusID INNER JOIN HelpdeskOperator ho ON p.HelpdeskID = ho.HelpdeskID AND s.StatusID = ho.StatusID INNER JOIN Priority pr ON p.PriorityID = pr.PriorityID INNER JOIN [Skill Group] sg ON p.SkillGroupID = sg.SkillGroupID INNER JOIN Technician t ON p.ProblemID = t.ProblemID AND s.StatusID = t.StatusID AND pr.PriorityID = t.PriorityID AND sg.SkillGroupID = t.SkillGroupID </code></pre> <ol> <li>You had duplicate table identifier in your join clause <code>Status.Status.StatusID</code></li> <li>I doubt that your <code>Skill Group</code> table contains column <code>[Skill Group]</code> so changed it to return all values from <code>Skill Group</code></li> </ol> <p>I just think those were the errors, if not I will need more info about your query and table structure.</p> <p><strong>EDIT:</strong></p> <p>First it did not return anything for <code>HelpdeskOperator</code>, look at our query:</p> <pre><code>INNER JOIN HelpdeskOperator ho ON p.HelpdeskID = ho.HelpdeskID AND s.StatusID = ho.StatusID </code></pre> <p>that meanse that here is no such <code>HelpdeskOperator</code> record that is assigned to our problem AND statusid, so either problem id points to noexisting helpdeskoperator or statusid of this operator is different that problem status id.</p> <p>next is <code>Skill Group</code></p> <pre><code>INNER JOIN [Skill Group] sg ON p.SkillGroupID = sg.SkillGroupID </code></pre> <p>again our problem point to no existing skill group</p> <p>then <code>Technican</code></p> <pre><code>INNER JOIN Technician t ON p.ProblemID = t.ProblemID AND s.StatusID = t.StatusID AND pr.PriorityID = t.PriorityID AND sg.SkillGroupID = t.SkillGroupID </code></pre> <p>here is more work as more checks, technicas must be assigned to our problem with given status and priorityt and be in skill group, BUT our skill group is null? so to check if there is technican for our problem remove <code>AND sg.SkillGroupID = t.SkillGroupID</code> so you get </p> <pre><code>INNER JOIN Technician t ON p.ProblemID = t.ProblemID AND s.StatusID = t.StatusID AND pr.PriorityID = t.PriorityID </code></pre> <p>and see if now we get any technican.</p> <p>I hope this points you into right direction. You must be sure that there are matching record in every joining table.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload