Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
I am having 2 tables which contains the product deatils
In first Table i am using left(ProdCode,3) as Products to extract products with first 3 charcters
and from Table 2
i am using left(Prodcode,3) as P1
left(Prodcode,4) as P2
left(Prodcode,5) As P3
Now i want to join Table 1 and Table 2 on condition where Left(Prodcode,3) from table 1 matches P1,P2,P3 so that a product hiearchy is formed.
I am stuck
can anyone help me.
Thanks in advance
Hi,
Try out this below code.
Table1:
Load
left(ProdCode,3) as Products
From..... ;
Table2_Old:
left(Prodcode,3) as P1,
left(Prodcode,4) as P2,
left(Prodcode,5) As P3,
from ..... ;
Noconcatenate
Load P1,
P2,
P3
Resident Table2_Old where exists(Products,P1);
drop table Table2_Old;
- Sridhar