SELECT DISTINCT ON (mf.parcelle.code_site, join1.code_acte)
	mf.parcelle.code_site,
	join1.code_acte,
	join1.type_maitrise
FROM (	SELECT acte.code_acte,
			type_maitrise.type_maitrise
		FROM mf.acte
		LEFT JOIN mf.type_maitrise ON acte.ref_type_maitrise = type_maitrise.id_type_maitrise ) join1
LEFT JOIN mf.parcelle ON join1.code_acte::text = mf.parcelle.code_acte::text
WHERE (parcelle.code_acte LIKE '37%') ORDER BY code_site, code_acte
