Re: sql problem

From: Stephan Born <stephan.born_at_beusen.de>
Date: Mon, 25 Oct 1999 11:00:00 +0200
Message-ID: <38141C10.E0E6E636_at_beusen.de>


> i have 2 tables A and B. table A has a py key col1 and a description
> field col2. table B has 2 columns....colx references col1 of table A
> and coly references col1 of table A.
>
> i need to get a report that lists as follows;
>
> colx corresponding-col2 coly corresponding-col2
>
> i would prefer it if i could create a view for this. i have spent the
> whole day on this with no luck.
>

Both coloums in tab B reference col1 from tab A?

create or replace view myview as
select

    B.colx,
    a1.col2,
    B.coly,
    a2.col2
from

    A a1,
    A a2,
    B
where

    B.colx = a1.col1 and
    B.coly = a2.col1;

I didn't try this statement so it can be bugy....but I think it will fulfill you needs.

Let me know :o)

Regards, Stephan

--
---------------------------------------------------------------
Dipl.-Inf. (FH) Stephan Born   | beusen Consulting GmbH
fon: +49 30 549932-17          | Landsberger Allee 392
fax: +49 30 549932-29          | 12681 Berlin
mailto:stephan.born_at_beusen.de  | Germany
---------------------------------------------------------------
Received on Mon Oct 25 1999 - 11:00:00 CEST

Original text of this message