I want to merge two tables using UNION but getting common primary key twice that i dont want. -

Setup Info
Partner, Registered Posts: 1 Partner

I want to merge two tables using UNION but getting common primary key twice that i dont want. - I want one occurrence of primary key .

Example :

Table 1 Table 2

Id Name Country Id Name Country

1 Ed England 2 Megha India

2 Megha India 3 Ved Germany

3 Ved Germany 4 Ram Japan

Desired Output:

Id Name Country

1 Ed England

2 Megha India

3 Ved Germany

4 Ram Japan

Answers

  • Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer Posts: 102 Dataiker

    Hi,

    Could you share the query you are using (a screenshot of the query and output will be the best)? I suspect you are using UNION ALL, so the duplicates are kept. UNION should combine the tables into a distinct single result.

    Best

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.