From: | Hellmuth Vargas <hivs77(at)gmail(dot)com> |
---|---|
To: | Lista PostgreSql <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | Re: separar datos de un campo |
Date: | 2011-08-19 16:31:32 |
Message-ID: | CAN3Qy4oqoaR45mObpXGsb4Y=yEYhTrRzwVTNcMaSnYNzo5PQog@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Hola
según veo en la documentación, para acceder a los componentes x,y de
un datos point seria similar al de los arreglos por lo tanto para x
seria campo[0] y para y campo[1]
osea que un select tentativo seria
SELECT campo_punto[0] AS x, campo_punto[1] AS y FROM tabla....
http://www.postgresql.org/docs/8.4/static/functions-geometry.html
"It is possible to access the two component numbers of a point as
though the point were an array with indexes 0 and 1. For example, if
t.p is a point column then SELECT p[0] FROM t retrieves the X
coordinate and UPDATE t SET p[1] = ... changes the Y coordinate. In
the same way, a value of type box or lseg can be treated as an array
of two point values."
2011/8/19 Miguel Angel Hernandez Moreno <miguel(dot)hdz(dot)mrn(at)gmail(dot)com>:
> Saludos lista
>
> Tengo un campo tipo point en una tabla, el cual contiene la latitud (
> coordenada posotiva)y longitud (coordenada negativa)
>
> (-100.298390507273,25.6720346672794)
>
> lo que deseo es hacer un select a este registro pero manejarlo de tal forma
> que me regrese por separado las coordenadas,
> pense manejarlo con expresiones regulares en uan funcion de postgres y
> evaluar el registro
>
> pero no se si podria hacer mejor solo en un select
>
> --
> ISC Miguel Angel Hernandez Moreno
>
>
--
Cordialmente,
Ing. Hellmuth I. Vargas S.
From | Date | Subject | |
---|---|---|---|
Next Message | Miguel Angel Hernandez Moreno | 2011-08-19 16:39:12 | Re: separar datos de un campo |
Previous Message | Jose David Verbel Tous | 2011-08-19 16:25:38 | Re: Problemas con pgpool |