I basically have a table A with 30 million records and I want to add a column entitled “TYPE” to the table. I have a look up table B that maps a code to a color. I want to iterate through table A and compare the code in TABLE A to the code in TABLE B and then add the color to the TYPE column in table A. Is this possible? What would be the best approach to this problem? The codes in table B don’t match perfectly with the actual codes in table A.
Share
hard to say without seeing the schema or knowing the DBMS but, if it’s always a the first 2 digits of the code used to look up the color, why not
and do a JOIN normally
you could do a join like
but that would hardly be performant.