Question

Joining 2 tables without duplicating the same entries associated

  • 10 June 2021
  • 0 replies
  • 12 views

I have 2 tables (see below): 

Whats the best way of joining them so I can have consolidated Customer ID list (1.0 + 2.0) but the records are not duplicated. so:

  1. if I do a total of points earned (so one address will only get counted once despite there are 2 separate customer ids)
  2. The Customer ID list will still list individually and show me the address and points earned accordingly. (i.e, I don’t want it to display as 2,5 | 234 street | 15 points earned . I would like to see 2 | 234 street | 15 points earned , 5 | 234 street | 15 points earned)

Table 1

Customer_ID_1.0 Address points earned
1 123 street 20
2 234 street 15
3 345 street 30
4 456 street 40

 

Table 2

 

Customer_ ID_2.0 Address points earned
5 234 street 15
6 123 street 20

 

Hope it make sense!


This topic has been closed for comments