maptiles/layers/place/capital.sql

11 lines
305 B
MySQL
Raw Permalink Normal View History

2025-01-16 20:45:43 +01:00
CREATE OR REPLACE FUNCTION normalize_capital_level(capital text)
RETURNS int AS
$$
SELECT CASE
WHEN capital = 'yes' THEN 2
WHEN capital IN ('2', '3', '4', '5', '6') THEN capital::int
END;
$$ LANGUAGE SQL IMMUTABLE
STRICT
PARALLEL SAFE;