I am using mysql to count the number of point features (shops) within a polygon feature (postsec).
The select query I have works fine, but I want to update table postsec with the generated results. The query I have is below:
select pc_sec, count(*) as count from shops
join postsec on st_within(shops.SHAPE,postsec.SHAPE)
where shops.shop_cat > 0 and shop_cat < 10 group by pc_sec
I have tried a number of methods for doing this e.g. update postsec set new_column = ([select query]) but can't seem to find the right way.