Working with QGIS 3.10. Details:
This should be really simple, but I am unable to solve it:
I've got a point layer with two numeric fields "max"
and "min"
, and a polygon layer. I want to create a Virtual layer with the polygons and the sums of "max" and "min" of the points that are within each polygon. All my tries around the following code result in QGIS crash
SELECT polygon.name,
polygon.geometry,
SUM(point.max) AS maxim,
SUM(point.min) AS minim
FROM polygon
JOIN point ON st_within (point.geometry, polygon.geometry) = 1
GROUP BY polygon.name, polygon.geometry
My layers have shapefiles as their data source.