Skip to main content
4 events
when toggle format what by license comment
Dec 3, 2019 at 7:03 comment added Leehan You are completey right. That was the issue.
Dec 2, 2019 at 15:08 comment added J. Monticolo That's, I think, because you group by geom when geom is the same name as the PostGIS table geometry column. If, under PostGIS, in your query, you change as geom2 and group by geom2, you'll find the same result as virtual layer.
Dec 2, 2019 at 14:56 comment added Leehan Yes I agree in PostGIS and DB manager. But like I said in first post, when using a virtual layer (Spatialite) in QGis the query : select st_snaptogrid(m.geometry, 25) as geom, count( case when var Like 'C_ram%' THEN 1 END), count( case when var Like 'Lith%' THEN 1 END ) from mytabl m group by geom returns the correct result without the FROM SELECT (). I was (am) confused about this.
Dec 2, 2019 at 14:45 history answered J. Monticolo CC BY-SA 4.0