I have a table that looks like this:
CREATE
OR
REPLACE
TYPE subaccount_nt
IS TABLE OF VARCHAR2(30);
CREATE
TABLE my_table
( contract_id NUMBER(38,0)
, subaccount SUBACCOUNT_NT );
Here's some sample data:
100 [1000, 1, 2]
200 [2000, NULL, 999]
300 [3000]
How can I write a query to return the the third row from the nested table if the 3rd row exists? Here's the output I'm trying to get:
100 1
200 NULL
300 NULL
Haeving never worked with nested tables before, I'm finding it quite hard to forumate my query. Thanks.