Skip to content

Commit 8f52fed

Browse files
committed
Passa a usar jurisdiction_abbrev_option. osm-codes/WS#31 osm-codes/CO_new#17
1 parent aeec070 commit 8f52fed

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/optim-step4-api.sql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,23 @@ FROM (
292292
) t
293293
;
294294

295+
--DROP MATERIALIZED VIEW mvwjurisdiction_synonym;
295296
CREATE MATERIALIZED VIEW mvwjurisdiction_synonym AS
297+
(
298+
-- identidade
299+
SELECT isolabel_ext AS synonym, isolabel_ext AS isolabel_ext
300+
FROM optim.jurisdiction
301+
)
302+
UNION ALL
303+
(
304+
-- não deve retornar abbrev repetidos
305+
SELECT abbrev, MAX(isolabel_ext)
306+
FROM optim.jurisdiction_abbrev_option
307+
WHERE selected IS TRUE
308+
GROUP BY abbrev
309+
HAVING count(*) = 1
310+
)
311+
UNION ALL
296312
(
297313
-- co unique names
298314
-- eg.: CO-Medellin

0 commit comments

Comments
 (0)