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

Was it helpful?

Solution

SELECT 
   name 
FROM 
   tblshops
WHERE 
   st_contains((select shape from tbltowns where name='London'), location)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top