I've got a database with the following tables
CREATE TABLE survey (
id_s integer primary key,
eventdate timestamp without time zone,
locality character varying(100)
geom geometry(Point,25830))
CREATE TABLE provinces (
id_p integer primary key,
name character varying(100)
geom geometry(Polygon,25830))
A simple query would be
SELECT locality, eventdate
FROM provinces p, survey s
WHERE st_contains (p.geom,s.geom) and name = 'myprovince'
But, in order to save space (and, hopefully, speed queries), I re-structured the database as follows:
The problem now is that I can't figure out how to construct that simple query. What woud be the syntax?