1
我是子查詢保理子句的忠實粉絲。oracle 12c使用子查詢保理子句與plsql聲明
WITH t1 as (select 1 as id from dual)
select * from t1;
和Oracle 12c中現在包括在WITH子句的PL/SQL聲明部分
WITH
FUNCTION with_function(p_id IN NUMBER) RETURN NUMBER IS
BEGIN
RETURN p_id;
END;
SELECT with_function(id)
FROM t1
WHERE rownum = 1
,但我似乎無法讓他們一起工作這可能嗎?
WITH t1 as (select 1 as id from dual)
WITH FUNCTION with_function(p_id IN NUMBER) RETURN NUMBER IS
BEGIN
RETURN p_id;
END;
SELECT with_function(id)
FROM t1
WHERE rownum = 1;