Created
October 24, 2013 21:26
-
-
Save flash-gordon/7145319 to your computer and use it in GitHub Desktop.
oracle nested tables example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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