-- View: "Vu_fds_nb_persons_destination"

-- DROP VIEW "Vu_fds_nb_persons_destination";

CREATE OR REPLACE VIEW "Vu_fds_nb_persons_destination" AS 
 SELECT fds_t_destination.destination, sum(fds_evenement.adherents) AS nb_adherent, sum(fds_evenement.enfants) AS nb_enfants, sum(fds_evenement.non_adherents) AS nb_non_adherents
   FROM fds_evenement, fds_t_destination
  WHERE fds_evenement.ref_destination = fds_t_destination.ref_destination AND fds_evenement.date ~~ '2008%'::text
  GROUP BY fds_evenement.ref_destination, fds_t_destination.destination;

ALTER TABLE "Vu_fds_nb_persons_destination" OWNER TO postgres;

