-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
142 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
The following SQL query will remove all region geometry that are not California: | ||
|
||
```sql | ||
SELECT | ||
rg.region_id | ||
FROM | ||
region | ||
INNER JOIN | ||
region_geometry rg | ||
ON | ||
region.id = rg.region_id | ||
WHERE | ||
region.parent_region_id IS NULL | ||
AND region.parent_region_id != 'texas'; | ||
``` | ||
|
||
```sql | ||
DELETE FROM region_geometry | ||
USING region | ||
WHERE region_geometry.region_id = region.id | ||
AND region.parent_region_id != 'texas'; | ||
``` | ||
|
||
The following SQL query will remove all region geometry that are not California and are not a child of California: | ||
|
||
```sql | ||
DELETE FROM region | ||
WHERE region.parent_region_id != 'texas' AND region.id != 'texas'; | ||
``` | ||
|
||
Delete all region that the id is not `texas` and the `parent_region_id` is `NULL`: | ||
|
||
```sql | ||
DELETE FROM region | ||
WHERE region.parent_region_id IS NULL AND region.id != 'texas'; | ||
``` |
Oops, something went wrong.