I have a table with two relevant columns, an ID and a VARRAY of doubles representing coordinates like this: (x1, y1, x2, y2, x3, y3, …). The length of this array varies from four to dozens.
I need to write a view that takes all of these rows and expands each of them into several rows with an order field, like this:
ID order X Y 1 1 x1 y1 1 2 x2 y2 1 3 x3 y3 2 1 x1 y1 2 2 x2 y2 2 3 x3 y3
Google is no help, and being someone only mediocre at SQL (and mostly in PostgreSQL), the Oracle documentation is impossible to find advanced things in.
I for myself like piplined tables, heres a solution that uses it:
now you can query it like this:
I used
as the table name