Home » RDBMS Server » Server Administration » How does EXISTS work?
How does EXISTS work? [message #372874] Thu, 15 March 2001 02:42 Go to next message
Corvax
Messages: 1
Registered: March 2001
Junior Member
Hi, all.
Could somebody tell me how does EXISTS work exactly? I want to know, 'cause I have to determine which of the following queries will work faster:
1.
SELECT 1 FROM dual
WHERE EXISTS (SELECT 1 FROM table where_clause);

2.
SELECT 1 FROM dual
WHERE NOT EXISTS (SELECT 1 FROM table where_clause);

The main idea is to determine if there are some rows in the table or not. And what is the fastest way to do it.

Thanks in advance.
Re: How does EXISTS work? [message #372877 is a reply to message #372874] Thu, 15 March 2001 06:07 Go to previous message
Thirumalai Prakash
Messages: 6
Registered: March 2001
Junior Member
Hi Corvax,

Method 1 is faster than 2.
Previous Topic: ERROR-MESSAGE 20955 / 21408
Next Topic: Could you help me?
Goto Forum:
  


Current Time: Mon Jun 17 02:31:04 CDT 2024