select b.productcode, a.symptom
from table_a a
inner join table_b b on a.id = b.tablea_id
where not productcode is null
order by b.productcode asc, a.symptom desc
New version:
select
b.productcode,
b.comment,
a.symptom,
case
when a.weight = (select max(weight) from table_a) then 'High'
else 'Low'
end as 'Priority'
from
table_a a
inner join
table_b b on a.id = b.tablea_id
(...)