
CREATE OR REPLACE VIEW spatial.vu_mf_18021A AS 
SELECT mf.*,
	bdp.gid,
	bdp.geom
FROM (SELECT * FROM mf_generale WHERE code_site='18021A') AS mf
JOIN (SELECT gid, cleparc, geom FROM spatial.bdp_parcelle WHERE code_dep='18') AS bdp ON bdp.cleparc=mf.cleparc;

ALTER TABLE spatial.vu_mf_18021A OWNER TO ludodo;
GRANT ALL ON TABLE spatial.vu_mf_18021A TO postgres;
GRANT ALL ON TABLE spatial.vu_mf_18021A TO geomatique;
GRANT SELECT ON TABLE spatial.vu_mf_18021A TO cpnrc;
