I have a table with county polygon boundaries (named "counties"). I need to build a query that identifies a particular county as well as any adjoining counties that share the same border. Have tried breaking this down but I'm missing something. Any ideas?


You can create a Virtual Layer that will query the polygon layer twice and apply the desired filtering.

go to the menu Layer > Add Layer > Add/Edit Virtual Layer... and enter the query

FROM myLayer a
JOIN myLayer b ON ST_INTERSECTS(a.geometry,b.geometry)
WHERE a.id <> b.id 
AND a.id = 1234

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.