i have two tables which doesn't have a common key i wanted to do a join on these two tables without a cartesian join. Table 1 had around 40,000 ( record count varies in every day production ) rows while table2 present count is 80,000 rows ( record count varies in every day production ).
TABLE1 :- NAME_VALUES
NAME_VAL
--------
TOM
DICK
HARRY
TABLE2 :- CUS_TABLE
CUS_ID
---------
401795480
201134211
137643082
876450821
777290153
111035791
579865552
I wanted to have some thing like below as output
401795480 TOM
201134211 DICK
137643082 HARRY
876450821 DICK
777290153 HARRY
111035791 TOM
579865552 DICK
My idea was to assign rownumber for each table . For table 2 i would like to restart the rownumber once the maximum count of table 1 is reached some thing like below but unable to figure out how can i perform
Table1
NAME_VAL TABLE1_RN
---------------------
TOM 1
DICK 2
HARRY 3
Table2
CUS_ID TABLE2_RN
--------------------
401795480 1
201134211 2
137643082 3
876450821 1
777290153 2
111035791 3
579865552 1
Now i have a key and can easily map to fetch the details i require.
Please suggest if any method can satisfy my requirement.