Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: compound SQL queries and DISTINCT problem
> If you use the minus operator in the following way:
>
> select x from table1
> minus
> select x from table2
>
> you will get the result
>
> x
> ---
> B
> D
>
> despite of the fact, that table1 contains the row B two times. I'd like to
> get the result:
>
> x
> ---
> B
> B
> D
>
> Any ideas ? Would be great.
The only idea I have is:
SELECT x FROM table1 WHERE x=(
SELECT x FROM table1
MINUS
SELECT x FROM table2);
Regards,
Knut
-- Knut Talman Fon +49 30 72 62 01 411 dba_at_myToys.de Fax +49 30 72 62 01 222 The degree of normality in a database is inversely proportional to that of its DBAReceived on Wed May 30 2001 - 10:35:42 CDT