Hi all, thanks for your help, effectively I didn't take care about duplicated gids. To avoid this, I have changed the view to : SELECT com.gid, com.the_geom, com.region, nrj_com.* FROM (SELECT nrj.commune, sum(nrj.cha) AS cha, sum(nrj.ecs) AS ecs, sum(nrj.cui) AS cui, sum(nrj.spe) AS spe, sum(nrj.total) AS total FROM residentiel.nrj_sourcesfixes nrj GROUP BY nrj.commune ) AS nrj_com JOIN spatial.commune com ON nrj_com.commune::text = com.code_insee::text;
where "select count(gid) from <view> group by gid having count(gid)>1" returns nothing. However, QGIS complains again about not finding uniques int4 values, but performing a CREATE TABLE table AS <query_creating_view> is perfectly displayed in QGIS!!!! Cheers 2010/6/1 Andrea Peri 2007 <aperi2...@gmail.com>: > Hi Lionel, > > try a query like this: > > select count(gid) from <view> group by gid having count(gid)>1 > > to see if there is some duplicates. > > Regards, > > Andrea. > > _______________________________________________ > Qgis-user mailing list > Qgis-user@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/qgis-user > -- Lionel Roubeyrie lionel.roubey...@gmail.com http://youarealegend.blogspot.com _______________________________________________ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user