Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: need crash course in EXISTS
Hi Doug,
Please understand that an exists query has no meaning when you have no join in the inner query with the field in the outer query. What you are getting now , I am sure, is just the number of rows in table A, because the exists clause is TRUE for all rows in table A(outer query), because your inner query returns 81 rows for every row in your outer query. So you end up getting all rows in table A, Simple!!
Hope this helps
Sanjay.
Doug Cowles <dcowles_at_bigfoot.com> wrote:
>two tables, identical layouts, let's call them A and B, each with a>number and a char
>for simplicity.
>
>This query yields 81 rows.
>select a from A
>MINUS
>select a from B
>
>This query returns 458 rows -
>select * from A
>where
>EXISTS
>(select a from A
>MINUS
>select a from B)
>
>What gives?
>
>- Dc.
>
Received on Sat May 29 1999 - 15:53:33 CDT
![]() |
![]() |