How do you avoid column name conflicts?

May be you can try using aliases on the table names ?

select * from table1 as T1
join table2 as t2 on (t1.key=t2.foreignkey)

You need to use AS alias.

You can give a table or a column another name by using an alias. This can be a good thing to do if you have very long or complex table names or column names.

An alias name could be anything, but usually it is short.


Your approach is correct, but you can also provide an alias for your table:

SELECT a.* FROM TableA A

in here you can refer to TableA as simply A.