or download this
select distinct i.id_ind from dna_plate p,dnaplate_status ps, dna_wel
+l w, individual_name i where p.id_dnaplate = w.id_dnaplate and w.id_c
+ontent = i.id_ind and p.plate_type = 13 and ps.id_dnaplate = p.id_dna
+plate and ps.status = 7 and p.id_study in(6637,7867) and i.name_type
+= 2 order by i.id_ind
...
and g.id_snp = ?
and g.disregard = 0
order by 2, 3, 4, 5, 6