
Originally Posted by
DaPi
Code:
select count(*) into v_count from test_abc_prices
where rownum = 1;
should be faster
Why do you need count(*) if you want only one row?
[/CODE]
This is slower to me.
Code:
SQL> set time on timing on
14:56:34 SQL> create table empty_table (id int) ;
Table created.
Elapsed: 00:00:00.04
14:56:47 SQL> select count(*) from empty_table where rownum = 1 ;
COUNT(*)
----------
0
Elapsed: 00:00:00.01 - one hundredth of a second.
14:57:12 SQL> select 1 from empty_table where rownum = 1 ;
no rows selected
Elapsed: 00:00:00.00 -- almost negilible
14:57:31 SQL>
Tamil