Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

table join with different column names

i have two tables like this.

Margin:

LOAD [SC-IM],

     GROUP,

     [Job Name],

     DESCRIPTION,

     [Critical ?],

     SLA,  

     [Last Run date],

     [Last Run time],

     trim([Last Run Timestamp]) as [Last End Timestamp],

     trim(PREDECESSOR) as Predecessors,

     trim(SUCCESSOR) as Successors

Resident Temp order by [Last Run Timestamp] asc,[Job Name] asc;

     

SUCCESSOR:

LOAD [Job Name]  as "Parent Job",

trim(mid(trim(subfield(Successors,',')),2)) as "Child Job"

Resident Margin order by [Job Name] asc;

Now i have to create two table objects like. If a "Job Name" is selected from List

1. object-Table1 should list all the columns of "Margin" table -- done

2. object-Table2 should look up "Margin".[Job Name] for each value of "SUCCESSOR".[Child Job] and list all detail for that Child job from "Margin"-- Is it possible ?

Any help is highly appreciated. Thanks in advance

MidhunGT

1 Reply
avinashelite

try like this:

add a column like this

  1. Margin: 
  2. LOAD [SC-IM], 
  3.      GROUP,  
  4.      [Job Name], 
  5. [Job Name] as "Parent Job",
  6.      DESCRIPTION,  
  7.      [Critical ?],  
  8.      SLA,    
  9.      [Last Run date], 
  10.      [Last Run time], 
  11.      trim([Last Run Timestamp]) as [Last End Timestamp], 
  12.      trim(PREDECESSOR) as Predecessors,  
  13.      trim(SUCCESSOR) as Successors 
  14. Resident Temp order by [Last Run Timestamp] asc,[Job Name] asc
  15.        
  16. SUCCESSOR: 
  17. LOAD [Job Nameas "Parent Job"
  18. trim(mid(trim(subfield(Successors,',')),2)) as "Child Job" 
  19. Resident Margin order by [Job Name] asc;

This should work.