9 Replies Latest reply: Sep 16, 2014 4:24 AM by surendra chunduri

# joining three tables with out any common coloumn

Hi all,

I been posed by this question by a colleague.

here is the scenario.

there three tables

table1 :

A,

B,

C

table2:

E,

F,

G,

Table3:

H,

I,

J

and the requirement is i need to use these three tables and create a new table where i just need the first coloumns from the three tables.

the out put could be like this as per the question

Table 4:

A,

E,

F

i thought of using a link table to connect all three but i am not sure whether i am taking the correct approach or not.

• ###### Re: joining three tables with out any common coloumn

Using what logic you want A E and F in Table 4... Can you please elaborate little more on this?

• ###### Re: joining three tables with out any common coloumn

Honestly i am not after any specific logic i am curious to know in what ways this can achieved.

Thanks,

Surendra

• ###### Re: joining three tables with out any common coloumn

A link table would also need some common columns

• ###### Re: joining three tables with out any common coloumn

Then use like this

table4 :

A,

//B,

//C

Join

//table2:

E,

//F,

//G,

//Table3:

join

H,

//I,

//J

It will create Cartesian product for you.

Regards

ASHFAQ

• ###### Re: joining three tables with out any common coloumn

Any other workarounds if any please

• ###### Re: joining three tables with out any common coloumn

You can even use

For other work arounds

Regards

ASHFAQ

• ###### Re: joining three tables with out any common coloumn

T1:

Load *, RowNo() as No Inline

[

Field

A

B

C

];

NoConcatenate

T2:

Load *, RowNo() as No Inline

[

Field

E

F

G

];

NoConcatenate

T3:

Load *, RowNo() as No Inline

[

Field

H

I

J

];

NoConcatenate

Load Field Resident T1 Where No = 1;

Load Field Resident T2 Where Match(No,1,2);

Drop Tables T1, T2, T3;

• ###### Re: joining three tables with out any common coloumn

Thanks Manish

• ###### Re: joining three tables with out any common coloumn

Thanks Ashfaq