ST_Y

Definition

ST_Y takes an ST_Point as an input parameter and return its y-coordinate.

Syntax

sde.st_y (p1 sde.st_point)

Return type

Double precision

Example

The y_test table is created with two columns: the gid column, which uniquely identifies the row, and the pt1 point column.

CREATE TABLE y_test (gid integer unique, pt1 sde.st_point);

The INSERT statements insert two rows. One is a point without a z-coordinate or measure. The other has both a z-coordinate and a measure.

Oracle

INSERT INTO Y_TEST VALUES (
1,
sde.st_pointfromtext ('point (10.02 20.01)', 0)
);

INSERT INTO Y_TEST VALUES (
2,
sde.st_pointfromtext ('point zm(10.02 20.01 5.0 7.0)', 0)
);

PostgreSQL

INSERT INTO y_test VALUES (
1,
sde.st_point ('point (10.02 20.01)', 0)
);

INSERT INTO y_test VALUES (
2,
sde.st_point ('point zm(10.02 20.01 5.0 7.0)', 0)
);

The query lists the gid column and the double-precision y-coordinate of the points.

Oracle

SELECT gid, sde.st_y (pt1) "The Y coordinate"
FROM Y_TEST;

       GID     The Y coordinate

         1          20.01
         2          20.01

PostgreSQL

SELECT gid, sde.st_y (pt1) 
AS "The Y coordinate"
FROM y_test;

       gid    The Y coordinate

         1          20.01
         2          20.01

11/18/2013