How to check the non matching values in one table referring another
Requirement: I have two tables, let's call them Table A and Table B. For this requirement I'll be referring only two columns from both tables i.e. Number and ID. I need to look for Numbers from Table A in the Table B and check if the ID(s) associated with the Number in Table B are not different in Table A. Please keep in mind that there can be duplicates as well as multiple IDs associated with the same Number.
Let's look at the below scenario for better understanding.
From this scenario - Numbers 124,126 and 127 falls under the issue category that I need to show the users.
In Table B there's an ID 4 which is related to Number 124 but not in Table A and 126 is straightforward as IDs don't match in both tables for this Number. For the Number 127, there's only one record in Table A but two in Table B and ID 9 is not present in Table A for the same Number.
123 is a straight match with ID 1 and 125 has only onw record in Table B compared to 3 records in Table A albeit one being a duplicate but ID 4 is present in the Table A as well so this one is fine.
I hope i have made the requirement clear, if not then please let me know. Any suggestion or help will be appreciated.
So, the expected outcome would probably be in the Table B itself like a Flag or something (or could also be a separate table connected to it)which would tell me that this particular Number has ID(s) related to it which are not there in the Table A for the same Number and also the second part would be to show the specific ID that's not matching in case of multiple IDs in Table A for the same Number.