I need to SELECT the following table of values in PostGIS 2.2:
nennweite character varying (10)
1",
100,
110,
125,
150,
200,
250,
...
These values type is varchar but i wan't to select them as numeric values so i tried
SELECT DISTINCT
CASE
WHEN lei.nennweite = '1"' THEN 25.4
ELSE CAST(lei.nennweite AS numeric)
END as d2
FROM public."WAS_LEITUNG" lei, qwat_vl.pipe_material vl_pipe_mat
WHERE lei.material = 1 AND vl_pipe_mat.value_fr = 'Fonte'
GROUP BY d2, vl_pipe_mat.id
ORDER BY d2
i get the following error
ERROR: Invalid input syntax for type numeric: « »
I tried many way to handle the ' " ' like using backslash, double quote, escape but i didn't manage to solve my problem.