SELECT
name
FROM
tblshops
WHERE
st_contains((select shape from tbltowns where name='London'), location)
MySQL select points which are contained in a polygon from a different table
-
11-07-2023 - |
Question
I have two tables.
Table a contains a list of names and locations (points) Table b contains a list of names and shape (polygons)
I want to write a query to find all points from a which are contained inside a given town from b
Something along the lines of
select name from tblshops where st_contains(select shape from tbltowns where name="London", location)
but I keep getting a syntax error. What am I doing wrong? Thanks
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow