-- View: mf.vu_actes_par_site

-- DROP VIEW mf.vu_actes_par_site;

CREATE OR REPLACE VIEW mf.vu_actes_par_site AS 
 SELECT DISTINCT ON (mf_parcelle.code_site, mf_acte.code_acte) mf_parcelle.code_site, mf_acte.code_acte, mf_acte.natr_acte, mf_acte.date_acte, mf_acte.nom_notaire, mf_acte.maitrise_fonciere, mf_acte.prix_acquisition, mf_acte.origine_propriete, mf_acte.duree_conv, mf_acte.echeance_prevue
   FROM mf.acte mf_acte, mf.parcelle mf_parcelle
  WHERE mf_parcelle.code_acte::text = mf_acte.code_acte::text;

ALTER TABLE mf.vu_actes_par_site OWNER TO ludodo;
GRANT ALL ON TABLE mf.vu_actes_par_site TO ludodo;
GRANT SELECT, REFERENCES, TRIGGER ON TABLE mf.vu_actes_par_site TO public;
GRANT SELECT, REFERENCES, TRIGGER ON TABLE mf.vu_actes_par_site TO cpnrc;

