Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I want to append records into one table from two different tables, but on my two tables the number of fields and field order arrangement is same for both. But here field names are different
Note : I cannot change the field names on Table2
Illustration
Table1
FieldName1 | FieldName2 | FieldName3 |
---|---|---|
aaa1 | aaa2 | aaa3 |
bbb1 | bbb2 | bbb3 |
Table2 (with different names - but table structure is same as Table1)
@1 | @2 | @3 |
---|---|---|
ccc1 | ccc2 | ccc3 |
ddd1 | ddd2 | ddd3 |
Result
FieldName1 | FieldName2 | FieldName3 |
---|---|---|
aaa1 | aaa2 | aaa3 |
bbb1 | bbb2 | bbb3 |
ccc1 | ccc2 | ccc3 |
ddd1 | ddd2 | ddd3 |
Result:
Load
'Table1' AS Source,
FieldName1,
FieldName2,
FieldName3
from
Table1;
Concatenate
Load
'Table2' AS Source,
@1 as FieldName1,
@2 as FieldName2,
@3 as FieldName3
from
Table2;
Should do it. Identifying the source in a separate column will help to refer back to your source files and for testing purposes.
Regards
Andy
Result:
Load
'Table1' AS Source,
FieldName1,
FieldName2,
FieldName3
from
Table1;
Concatenate
Load
'Table2' AS Source,
@1 as FieldName1,
@2 as FieldName2,
@3 as FieldName3
from
Table2;
Should do it. Identifying the source in a separate column will help to refer back to your source files and for testing purposes.
Regards
Andy
Hi Debabrata,
As Andy mentioned concatenate should solve your issue.
Thanks a lot Andy.