Hi, I've been stuck on this for a while now.
I have 2 tables:
Table1:
| Country_Key | Name | ID_1 | ID_2 | ID_3 | ID_4 |
| AD | Andorra | 123 | | | |
| AE | United Arab Emirates | 123 | | | |
| AG | Antigua and Barbuda | | 123 | | |
| AL | Albania | | | | 123 |
| AM | Armenia | | | | 123 |
| AO | Angola | | 123 | | |
Table2:
| Country_Key | Name | ID_Mapping |
| AD | Andorra | ID_1 |
| AE | United Arab Emirates | ID_3 |
| AG | Antigua and Barbuda | ID_2 |
| AL | Albania | ID_4 |
| AM | Armenia | ID_1 |
| AO | Angola | ID_2 |
I am trying to see if the IDs (ID_1, ID_2, etc.) are entered in the correct column in Table1 based on the ID_Mapping rules for each Country_Key in Table2. Basically trying to check for e.g. for Country_Key: AD, information is entered in column ID_1 only. Can anyone help me out with this?
Thank you!!