| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: difference between UNION operator and OR in where clause
On Jul 10, 1:19 pm, Lennart <erik.lennart.jons..._at_gmail.com> wrote:
> Mike wrote:
>
> [...]
>
> > 3 t-3
> > 2 d-2
> > 3 d-3 FALSE
>
> I'll remove all columns but pubid, can you describe why you think this
> evaluates to FALSE?
>
> publication.pubid book.pubid journal.pubic
> 3 2 3
>
> /Lennart
Ops. I think there is a mistake in my previous output.
Anyway, after removing all columns except the pubid.
The cross product will be:
publication.pubid book.pubid journal.pubid where
1 1 3 TRUE
1 2 3 FALSE
2 1 3 FALSE
2 2 3 TRUE
3 1 3 TRUE
3 2 3 TRUE
Therefore, 4 records are TRUE.
So using solution 2, it will output 4 titles, whereas the correct one should be 3 titles.
However, if using solution 2 with "select DISTINCT", it will output 3 titles instead. Received on Tue Jul 10 2007 - 12:44:18 CDT
![]() |
![]() |