I have 2 tables, with a Month_Id written as '201310' to denote October 2013 for example.
Problem is, I have one table with this Column created as an Integer & another as a Varchar.
What is the best way to change one of them to to other so I can join them?
an integer would require less storage than a varchar. Also, the join would be slightly faster. From this point of view, it is better change varchar to integer.
I agree with Vlad, if you convert the varchar column to Integer, the join will become much fast, and also storage will be saved. you can go for integer.
I've created a workaround to achieve what I needed.
I added another Mon_Yr Column as an INTEGER datatype & then added an UPDATE statement to make the new 'Mon_Yr' Column = the Old One.
Is there an easier way to do this??
Well, i were thinking about writing either "much faster" or "slightly faster", and left the phrase "slightly faster" just to avoid any special expectations/commitments. I've seen cases in the field where it was, indeed, much faster.
Yes it should be a separate column - either in addition to the existing one, or instead of it.