I do not know if the title is appropriate, but come on.
I have in Table A (table of processes queried) two key fields (new_process and old_process) and I have in my table B my interest variable (new_process_process). In Table C, I have the conversion from the old process to the new one. Exemplifying:
Table A
pcs_novo pcs_antigo outras_A
A NULL X
B NULL X
NULL AA X
NULL BB X
C NULL X
A NULL X
NULL AA X
Table B
pcs_novo assunto
A 1
B 2
C 3
D 4
E 5
F 6
Table C
pcs_antigo pcs_novo
AA D
BB E
CC F
Of course, I want to:
Final Table
pcs_novo pcs_antigo assunto outras_A
A NULL 1 X
B NULL 2 X
D AA 4 X
E BB 5 X
C NULL 3 X
How do I get this?
Notes: In Table A, the process fields repeat. In Table B and C the fields are unique.