I have two tables that I’d like to join
Right now I just do :
SELECT * FROM (default_insurance)
JOIN default_profiles ON uid = default_profiles.id
WHERE `uid` = '1
problem is that both default_insurance and default_profiles contains a column named company, and I only want the one from default_insurance, but is there a way to make a join that will automatically prefer columns from one of the tables WITHOUT having to SELECT (all columns that I want)
You can always specify what exactly do you need (+use table aliases):
(MySQL example)
Above will return all columns from t1 and additionally column
companyfrom t2, but on your result it will be nameddefault_insurance_company.