I want to join two layers, a polygon layer
"plan" and a point layer
"education point". My goal is to join the data from
"education point" layer to the
"plan" layer if the point is inside a polygon.
Since some polygons don't intersect with any point, and I still want to keep those polygons visible, I used
left join. But the result only shows polygons intersecting with a point.
Here's my query:
SELECT pl.geometry,ed.* FROM "plan" AS pl LEFT JOIN "education point" AS 'ed' ON st_intersects(pl.geometry,ed.geometry) WHERE pl."function" in ('primary school', 'middle school') AND ed."studyArea"='yes'