I have what started out as a fairly simple (to me anyway) query, that has evolved into a monster.
Now I am struggling with the parenthesis as I am nesting inner joins, so can anyone tell me the rules for nesting correctly?
Now I am struggling with the parenthesis as I am nesting inner joins, so can anyone tell me the rules for nesting correctly?
Code:
select b.assigned_to as b_assigned_to
, b.bug_id as b_bug_id
, b.bug_name as b_bug_name
, b.priority_id as b_priority_id
, b.project_id as b_project_id
, b.status_id as b_status_id
, b.test_id as b_test_id
, p.project_id as p_project_id
, p.project_name as p_project_name
, p1.priority_id as p1_priority_id
, p1.priority_desc as p1_priority_desc
, e.employee_id as e_employee_id
, e.employee_name as e_employee_name
, s.status_id as s_status_id
, s.status as s_status
, tst.pk as tst_ID
from bugs b
inner
join (projects p inner join
(priorities p1 inner join
( employees e [innerjoin
(statuses s inner join
on b.status_id = s.status_id)
on b.assigned_to = e.employee_id)
on b.priority_id = p1.priority_id )
on b.project_id = p.project_id)
left outer
join TestCases tst
on b.test_id = tst.pk;