I'm not sure that CR is the tool for learning SQL.
what is missing is how table1 and table2 relate to each other...
a better sql statement would be something like:
select
t1.patient_number,
t2.patient1_number,
t2.patient2_number,
t2.patient3_number
from table1 as t1
join table2 as t2
on t1.somefield = t2.somefield
where {patient number} = t1.patient_number
or {patient number} = t2.patient1_number
etc
HTH