可以,有许多例子可以在本论坛找到,这里再举例一下select b.Id,a.name from a,(select rownum id from user_tab_cols) b a.id(+)=a.bid 具体实现上用b表这样的方式不是很妥当,最好用pipe函数。
搜索的关键自能告诉我吗pipe搜不到 管道也不行
sample : Create or replace type type_num is table of number; create or replace function f_p(p_row in number) return type_num pipelined is begin for i in 1..p_row loop pipe row(i); end loop; end;select * from table(f_p(10)); COLUMN_VALUE ------------ 1 2 3 4 5 6 7 8 9 1010 rows selected
select a.rid, b.name from (select rownum rid from dual connect by rownum < 100) a, 表A b where a.rid = b.id(+);
select tmpA.id, A.name from (select rownum id from dual connect by rownum < 100) tmpA left outer join A on tmpA.id=A.id order by tmpA.id
a.id(+)=a.bid
具体实现上用b表这样的方式不是很妥当,最好用pipe函数。
管道也不行
Create or replace type type_num is table of number;
create or replace function f_p(p_row in number) return type_num pipelined
is
begin
for i in 1..p_row loop
pipe row(i);
end loop;
end;select * from table(f_p(10));
COLUMN_VALUE
------------
1
2
3
4
5
6
7
8
9
1010 rows selected
from (select rownum rid from dual connect by rownum < 100) a, 表A b
where a.rid = b.id(+);
from (select rownum id from dual connect by rownum < 100) tmpA left outer join A on tmpA.id=A.id order by tmpA.id