select string_agg(longitude::text||' '||latitude::text, ',')
from mytable
How to return a query on only one column?
-
02-10-2022 - |
Вопрос
wish my query the database to return me only one column!
select longitude, latitude
from mytable;
longitude latitude 42.74575 -5.096483 42.745567 -5.097 42.745 -5.098717
I wanted to like this:
-42.74575 -5.096483, -42.745567 -5.097, -42.745 -5.098717
Решение
Другие советы
I believe that is what you need ...
SELECT to_char(longitude, 'FM9999') || ' ' || to_char(latitude, 'FM9999') FROM mytable
If you don't know how many digits there are, just estimate the maximum: 'FM999999999999999999'
Не связан с StackOverflow