Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Please help on SQL
On Wed, 25 Mar 1998 22:09:18 -0000, "Burnett" <burnett_at_burnettms.demon.co.uk> wrote: Hi,
think you where too restrictive.
What's about
SELECT DISTINCT foo1.a, foo1.b
FROM foo f1,
foo f2 WHERE (f001.a = f002.a AND f001.rowid != f002.rowid /* To prevent rows mathing themselves */) OR (f001.b = f002.b AND f001.rowid != f002.rowid /* To prevent rows mathing themselves */)
>Try;
>
>SELECT DISTINCT foo1.a, foo1.b
>FROM foo f1,
> foo f2
>WHERE
> f001.a = f002.a AND
> f001.b = f002.b AND
> f001.rowid != f002.rowid /* To prevent rows mathing them
>selves */
>
>The statement reads (in English)
>
>Select foo column a and foo column b from foo where there is another row
>with an itdntial value of in column a and column b.
>
>
-- Regards Matthias Gresz :-) GreMa_at_T-online.deReceived on Thu Mar 26 1998 - 00:00:00 CST