Which SELECT query should be used to extract latitude and longitude from a point?
I can not use PostGIS.
An example of a point (point type value) stored in a database:
my_point
--------------
(50.850,4.383)
Expected result after query execution:
lat | lng
---------------
50.850 | 4.383
The query below works fine, but it does not look effective.
SELECT split_part(trim(my_point::text, '()'), ',', 1)::float AS lat, split_part(trim(my_point::text, '()'), ',', 2)::float AS lng FROM my_table;
rafis source share