1
SELECT materialized_genoview.genotyping_project_id,
2
trialterm.cvterm_id AS trial_type_id
3
FROM (((materialized_genoview
4
JOIN materialized_phenoview USING (accession_id))
5
JOIN projectprop trialprop ON (((materialized_phenoview.trial_id = trialprop.project_id) AND (trialprop.type_id IN ( SELECT cvterm.cvterm_id
6
FROM (cvterm
7
JOIN cv USING (cv_id))
8
WHERE ((cv.name)::text = 'project_type'::text))))))
9
JOIN cvterm trialterm ON ((trialprop.type_id = trialterm.cvterm_id)))
10
GROUP BY materialized_genoview.genotyping_project_id, trialterm.cvterm_id;