Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: views and joins

Re: views and joins

From: Frank <franjoe_at_frisurf.no>
Date: Mon, 4 Jun 2001 15:39:01 +0200
Message-ID: <EcMS6.6196$lM3.118591@news1.oke.nextra.no>

Hi

> Did you mean b.id_b here or am I wrong?
>

It is probably a good idea to use b.id_b instead in the second query othervise a.id_a will
return NULL in some instanses.

> complicated when the number of tables increase to 10-15 and the number
> of rows in the tables increase...
>

I agree.

Is it possible for you to rework your problem like this?

New table
TABLE_DRIVING
ID (Primary keys from both from TABLE_A and TABLE_B)

This table contains all your id's from TABLE_A and TABLE_B, TABLE_........

TABLE A
    ID_A
    DATA_A TABLE B
    ID_B
    DATA_B Then the query could become:
CREATE VIEW v_my_view
AS
SELECT drv.id, a.data_a, b.data_b, ......... FROM table_driving drv,

            table_a a,
            table_b b,
            ........
            ......
WHERE drv.id = a.id_a(+)
AND      drv.id = b.id_b(+)
AND      drv.id=.......



Frank Received on Mon Jun 04 2001 - 08:39:01 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US