Hi,
I am fairly new to Oracle SQL and beg your patience with me.
I have 3 tables joined, I believe, appropriately, but clearly not as I get far too many results.
Here is the sql. . .
SELECT p.per_id,
p.per_first_names || ' ' || p.per_surname asFull_Name,
ass.asm_subject_id,
ah.ash_assessment_type
FROM o_persons p
INNER JOIN o_assessments ass
on p.per_id = ass.asm_subject_id
INNER JOIN o_assessment_header ah
on ah.ash_subject_id = p.per_id
WHERE ass.asm_context like '%ADULT%' and p.per_id = '520980'
ORDER BY p.per_id;
I have the Person table linked to the Assessments table and the assessment_header table is linked - so I cannot understand why I am getting 121 results when I should get 11.
Any help will be much appreciated.
Steven
I am fairly new to Oracle SQL and beg your patience with me.
I have 3 tables joined, I believe, appropriately, but clearly not as I get far too many results.
Here is the sql. . .
SELECT p.per_id,
p.per_first_names || ' ' || p.per_surname asFull_Name,
ass.asm_subject_id,
ah.ash_assessment_type
FROM o_persons p
INNER JOIN o_assessments ass
on p.per_id = ass.asm_subject_id
INNER JOIN o_assessment_header ah
on ah.ash_subject_id = p.per_id
WHERE ass.asm_context like '%ADULT%' and p.per_id = '520980'
ORDER BY p.per_id;
I have the Person table linked to the Assessments table and the assessment_header table is linked - so I cannot understand why I am getting 121 results when I should get 11.
Any help will be much appreciated.
Steven