Skip to content

Instantly share code, notes, and snippets.

@flash-gordon
Created October 24, 2013 21:26
Show Gist options
  • Save flash-gordon/7145319 to your computer and use it in GitHub Desktop.
Save flash-gordon/7145319 to your computer and use it in GitHub Desktop.
oracle nested tables example
create or replace type id_list as table of number
/
create table test_nested(
id number primary key,
ids id_list
)
nested table ids store as nested_ids
/
insert into test_nested(id, ids)
values (1, id_list(1, 2, 3))
/
insert into test_nested(id, ids)
values (2, id_list(5, 7))
/
commit
/
create index nested_idx on nested_ids(column_value)
/
select *
from test_nested
where 1 member of ids
/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment