ST_Y can take an ST_Point as an input parameter and return its y-coordinate.
Oracle
sde.st_y (p1 sde.st_point)
PostgreSQL
st_y (p1 st_point)
The y_test table is created with two columns: the gid column, which uniquely identifies the row, and the pt1 point column.
Oracle
CREATE TABLE y_test (gid integer unique, pt1 sde.st_point);
PostgreSQL
CREATE TABLE y_test (gid integer unique, pt1 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 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,
st_point ('point (10.02 20.01)', 0)
);
INSERT INTO y_test VALUES (
2,
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, st_y (pt1) AS "The Y coordinate"
FROM y_test;
gid The Y coordinate
1 20.01
2 20.01