You have several options for how you achieve this.
If you want to use a collection, you can use the TABLE function to select it, but the type of collection you are using becomes important.
for a brief example, this creates a database type, which is a table of numbers:
CREATE TYPE number_tab AS TABLE OF NUMBER /
Type created.
The next block then fills the collection and performs an elementary selection from it, using it as a table and attaching it to EMP
tables (with some output, so that you can see what is happening):
DECLARE
From this you can see that the TYPE collection of the database (number_tab) was considered as a table and could be used as such.
Another option is to simply attach your two tables, which you select in your example:
SELECT tt.* FROM table_two tt INNER JOIN table_one to ON (to.item = tt.cid);
There are other ways to do this, but the former can best suit your needs.
Hope this helps.
Ollie source share