What type of data are returned by the X() and Y() MySql functions that take a point field as parameter

671 Views Asked by At

I am not so into database. Into a geospatial query I have something like this:

SELECT X(gps) AS longitude, Y(gps) AS latitude FROM MyTable

Where the gps field hve point as type.

And it returnes value like:

29,3715    -2,1790

My doubt is: what is the exact type of data returned by the previous X() and Y() function?

2

There are 2 best solutions below

0
On BEST ANSWER

The documentation of MySQL function X() explains:

ST_X() and X() are synonyms. For more information, see the description of ST_X().

X() is deprecated as of MySQL 5.7.6 and will be removed in a future MySQL release.
Use ST_X() instead.

The documentation of ST_X() says:

ST_X(P)

Returns the X-coordinate value for the Point object p as a double-precision number.

0
On

Looks like a double-precision number

Here's the link, note that these functions are alias for st_x and st_y and are due for depreciation.

Regards,

James