plsql – 获取第一行 – 哪一个更好?
发布时间:2020-12-12 16:25:52 所属栏目:百科 来源:网络整理
导读: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; 或者这个: select x.idfrom(select t.id from table1 t where t.foo=p_foo order by t.c
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; 或者这个: select x.id from(select t.id from table1 t where t.foo=p_foo order by t.creation_date) x where rownum = 1 以上两者都有类似的结果,但我需要知道哪一个更有效! 这是Tom Kyte的口头禅:
http://tkyte.blogspot.com/2006/10/slow-by-slow.html (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |