-- View: spatial."vu_communes_I_sites"

-- DROP VIEW spatial."vu_communes_I_sites";

CREATE OR REPLACE VIEW spatial."vu_communes_I_sites" AS 
 SELECT DISTINCT ON (communes.gid) communes.gid, sites_emprise.codsit, sites_emprise.nom_site, communes.numero, communes.nomcomun, communes.the_geom
   FROM spatial.communes, spatial.sites_emprise
  WHERE st_overlaps(communes.the_geom, sites_emprise.geom)
  ORDER BY communes.gid;

ALTER TABLE spatial."vu_communes_I_sites" OWNER TO ludodo;
GRANT ALL ON TABLE spatial."vu_communes_I_sites" TO ludodo;
GRANT ALL ON TABLE spatial."vu_communes_I_sites" TO geomatique;

