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

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