Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help - "Business Day" Problem
"sybrandb" <sybrandb_at_gmail.com> a écrit dans le message de news: 1177681440.943124.58320_at_r30g2000prh.googlegroups.com...
| On Apr 27, 3:23 pm, "pankaj_wolfhun..._at_yahoo.co.in"
|
| Exactly.
| In fact the most efficient way to check for existence of a record is
| select 1
| from dual
| where exists
| (select 1
| from emp where empno = :1)
|
| Subqueries over DUAL: I love them!
|
| --
| Sybrand Bakker
| Senior Oracle DBA
|
Is this faster than:
select 1 from emp where empno = :1 and rownum = 1;
Predicate Information (identified by operation id):
1 - filter(ROWNUM=1)
2 - access("EMPNO"=TO_NUMBER(:1))
Your query:
Predicate Information (identified by operation id):
1 - filter( EXISTS (SELECT /*+ */ 0 FROM "EMP" "EMP" WHERE
"EMPNO"=TO_NUMBER(:1)))
3 - access("EMPNO"=TO_NUMBER(:1))
Regards
Michel Cadot
Received on Fri Apr 27 2007 - 11:30:27 CDT
![]() |
![]() |