How does EXISTS work? [message #372874] |
Thu, 15 March 2001 02:42 |
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.
|
|
|
|