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

Which join to Use ???

Hi All,

I have a TableA and TableB. Where TableA is Old database and TableB is new Database.

TableA has some data as shown below.

UniqueID     ContactName

TEAS_123    Test1

TEAS_345    Test2

TEAS_354    Test3

TableB has some Data. In TableB some data is migrated from old database and also the UniqueID of previous database is also captured.

UniqueID     OldUniqueID     ContactName

1                 TEAS_123        Test1

2                 TEAS_345        Test2

3                 TEAS_354        Test3

4                  Null                 NewRecord1

5                  Null                 NewRecord2

6                  Null                 NewRecord3

I need to join two tables so tat there will not be any data loss or duplicate records and also new records also should be added.

Please help me with this.

Thanks,

Keerthi KS

6 Replies
jagan
Luminary Alumni
Luminary Alumni

HI Keerthi,

Try Full Outer join so that no data will be missing.  Not sure why you are joining both the tables, already you have old data in the new database, so for the attached data there is no need to join the tables.

Regards,

Jagan.

Not applicable
Author

But few other tables use data from old database. There are other tables that are not linked to new database.

So i need to join.

Currently Qlikview is using Old database tables and only one new database table.

So somehow i need to join both.

Thanks,

Keerthi KS

jagan
Luminary Alumni
Luminary Alumni

Join always depends on the Scenario, try Left, Right and Full Outer join and check with which you got the expected results.  If you use Full Outer no data will be missed in both the tables.

Hope this helps you.

Regards,

Jagan.

HirisH_V7
Master
Master

Hi,

Try like this, If you want all the fields including your old data base ,

Capture.PNGCapture1.PNG

As automatically Full outer join works fine.

i hope this helps,

Regards,

Hirish

HirisH
“Aspire to Inspire before we Expire!”
SreeniJD
Specialist
Specialist

Hi Keerthi

Concatenate two Tables Table1 and Table2 and apply where condition such that where uniqueID is not in Table1.

Sreeni

ahmar811
Creator III
Creator III

use concatenate like that


TableA:

load * from TableA;

concatenate

TableB

load * from TableB;