LV_id number;
Cursor CR_test Is
select t.id
from table1 t
where t.foo = p_foo
order by t.creation_date;
Open CR_test;
Fetch CR_test
Into LV_id;
Close CR_test;
或者這一個:plsql - 獲得第一行 - 哪一個更好?
select x.id
from(select t.id
from table1 t
where t.foo=p_foo
order by t.creation_date) x
where rownum = 1
兩個以上做類似的結果,但我需要知道關於哪一個更高效!
+1非常適合靜態分析 – 2012-03-11 11:18:35