SELECT * from (SELECT * FROM plan_gestion  
		INNER JOIN rel_site_pg
		ON plan_gestion.id_pg=rel_site_pg.id_pg) AS PGRel, sites
	WHERE PGRel.code_site=sites.code_site;

CREATE OR REPLACE VIEW "pg_j_sites" AS
 SELECT pgrel.id_pg, pgrel.pg_nom, pgrel.pg_debut, pgrel.pg_fin, pgrel.pg_statut, pgrel.code_site, sites.libl_site, sites.code_ensemble
   FROM ( SELECT plan_gestion.id_pg, plan_gestion.pg_nom, plan_gestion.pg_debut, plan_gestion.pg_fin, plan_gestion.pg_statut, rel_site_pg.code_site
           FROM plan_gestion
      JOIN rel_site_pg ON plan_gestion.id_pg = rel_site_pg.id_pg) pgrel, sites
  WHERE pgrel.code_site = sites.code_site;;