Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE adresspoint
- (
- id character varying(3999) NOT NULL,
- "position" geometry(PointZ,25832)
- CONSTRAINT pk_adresspoint PRIMARY KEY (id)
- )
- CREATE INDEX adresspoint_idx_position
- ON adresspoint
- USING gist
- ("position");
- CREATE TABLE house
- (
- id character varying(3999) NOT NULL,
- adresspointid character varying(3999),
- CONSTRAINT pk_house PRIMARY KEY (id)
- )
- CREATE INDEX house_idx_adresspointid
- ON house
- USING btree
- (adresspointid COLLATE pg_catalog."default");
- SELECT DISTINCT house.id
- FROM house
- LEFT JOIN adresspoint ON adresspoint.id = house.adresspointid
- AND st_contains(st_makeenvelope('562827','6326412','563365','6326590',25832),adresspoint.position)
- OFFSET 0 LIMIT 100
- SELECT DISTINCT house.id
- FROM house
- LEFT JOIN adresspoint ON adresspoint.id = house.adresspointid
- AND st_contains(st_makeenvelope('562827','6326412','563365','6326590',25832),adresspoint.position)
- WHERE adresspoint.id is not null -- ***change is here***
- OFFSET 0 LIMIT 100
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement