1
SELECT trialdesign.value AS trial_design_id,
2
materialized_phenoview.year_id
3
FROM (materialized_phenoview
4
JOIN projectprop trialdesign ON (((materialized_phenoview.trial_id = trialdesign.project_id) AND (trialdesign.type_id = ( SELECT cvterm.cvterm_id
5
FROM cvterm
6
WHERE ((cvterm.name)::text = 'design'::text))))))
7
GROUP BY trialdesign.value, materialized_phenoview.year_id;