Can I automate the "on" statement from MySQL queries?
If the columns were named the same in "both" tables, I think you could use NATURAL JOIN. Although that won't work for you, your consistency in naming should still let you generate queries--or at least the join clauses--with a scripting language.