Context: I want to perform left joins, but there are 2 PK that need to be satisfied such as : County and State
Reason: If I only have County as my PK, it seems wrong because one county can be in multiple states.
For example: Orange County, Ca . Orange County, FL. etc...
My main data is in the left table (Sample.csv) and the US zip as the right table
I want to bring the ZIP Code and City from Uszips file to Sample.csv
I already tried my best to join them. But, not sure if it's right? or maybe I'm over thinking it?
I hope someone can clarify this, thank you!
In the example below,
For combination of Alabama and Autauga, it has multiple records in both of your input files.
When we do join, it will generate 7x 3 = 21 records.
So how would you like to bring the City and Zip back to Sample.csv, maybe in a concatenaced format?
@Qiu so what should I do exactly? step by step?
Would you want me to concentenate County + State and make it as PK?
@Peachyco Hi, do you know if the multiple joins can be used to solve this problem?
@rively90
The question here is what do you want your output looks like?
Since we are joining State and County so there will be multiple City and Zip for each unique combination of State and County.
@Qiu Can we use unique filter? no?
@rively90
it mean you are ok to choose one random value of City and Zip for each unique combination of State and County.?
User | Count |
---|---|
19 | |
15 | |
13 | |
9 | |
8 |