top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

duplicate value in one row

0 votes
247 views

Produce the design approach to generate the below sample target data requirement from the sample source data.

SRC FILE1 TGT FILE
Col1 Col2 Col1 Col2
101 A 101 CBA
101 B 102 D
101 C 103 E
102 D 104 F
103 E 105 HG
104 F
105 G
105 H

please suggest me how to get the target file answer?

posted Jul 3, 2020 by Anamika Das

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
0 votes

I have data for current year as well as next year in a table.

Sample Table data:

Year,Period,prd_Desc,Amount
2014,11,    Humira,  120
2015,11,    humira,  140
Key Coulmn are Year,Period,prd_Desc

If the data present for next year and for same period, i need that value in a separate column. Like below

Year,Period,prd_Desc,Amount_curnt_yr,Amount_next_yr
2014,11,    humira,  120,            140

I can achive this by doint a left outer join between same table using below query:

select a.Year,a.Period,a.prd_Desc,a.Amount as Amount_curnt_yr,b.Amount as Amount_next_yr 
from (select Year,Period,prd_Desc,Amount 
      from tableA) a 

left outer join (select Year,Period,prd_Desc,Amount from tableA) b on
b.year=a.year+1 and a.Period=b.period and a.prd_Desc=b.prd_Desc
I was trying to get it in a simngle query without using left outer join, but could not. If anybody can share any idea, that would helps

+1 vote

I have a source with multiple columns -
minA, maxA, minB, maxB, minC, maxC, minD, maxD

and I have 2 columns in target min values, max values. How can i put the min values of elements in min values of target and same with max?

0 votes

Suppose if we have duplicate records in a table temp_n. Now I want to pass unique values to t1 and duplicate values to t2 in single mapping? How can we achieve?

...