select count(1) into tmpCount from tablename where .... and rownum < 2;
肯定比你的快.

解决方案 »

  1.   

    select count(1) into tmpCount from tablename where .... and rownum < 2;应该用这种方法
      

  2.   

    还有一种思路,效率也没测试过,是在外国一个产品中偷学的。
    declare
    cursor c_exist is 
    select 'x' from tablename where ......;
    begin
    ...
    open c_exist;
    loop
    if c_exist%notfound then
    ....
    else
    ...
    end if;
    end loop;
    end;
    大家发表点看法吧!
      

  3.   

    http://expert.csdn.net/Expert/topic/1196/1196592.xml?temp=.7349359
    上次测试的不准确,谁来测试一下
      

  4.   

    snowy_howe的办法是一个很常用的路子
    我很奇怪为什么大家都用
    SELECT COUNT(1)这个办法
    明明可以用游标来处理吗
    —————————————————————————————————
    该死的CSDN,把旧帖子都TMD删了,气死我了!!!