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

Home -> Community -> Usenet -> c.d.o.server -> Joining two tables without primary keys

Joining two tables without primary keys

From: Rajesh Jayaprakash <rajeshj_at_asdc.co.in>
Date: Sat, 21 Jul 2001 21:28:21 GMT
Message-ID: <3f97587f.0107042236.64368467@posting.google.com>

Hello everybody,

I have two tables (TAB1 and TAB2).

TAB1 has records as follows:

R1           R2

--- -------
1 2 1 2 3 4 1 2

TAB2 has the following records:

R1             R2          R3
---	  -------       -----
1	        2	    Y
1	        2	    Y	
3	        4           N
3	        4           N

There are no primary keys for either of the tables as duplicates are possible.
When I join the two tables using R1 and R2, I get a cartesian product.

But is it possible to get a result set which contains the number of rows exactly as in TAB1, i.e

R1           R2        R3

--- ------- -----
1 2 Y 1 2 Y 1 2 Y 3 4 N

Is it possible in any way to filter the result set so that the number of rows is same as that in TAB1?

One solution is to use the rowid of TAB1, but I would like to know if there is any other way.

Any help will be appreciated.

Thanks and regards,

Rajesh Jayaprakash Received on Sat Jul 21 2001 - 16:28:21 CDT

Original text of this message

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