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;
hay này:plsql - nhận hàng đầu tiên - cái nào tốt hơn?
select x.id
from(select t.id
from table1 t
where t.foo=p_foo
order by t.creation_date) x
where rownum = 1
Cả hai nói trên làm cho kết quả tương tự nhưng tôi cần biết về cái nào là hiệu quả hơn!
+1 để phân tích rất tốt với số liệu thống kê –