mdmartiny Posted August 9, 2014 Share Posted August 9, 2014 (edited) I have two different tables and I am trying to condense them into one table. The structure of the tables is cc -- ci -- cc -- cn -- alpha_2 countries -- id -- cn -- alpha_2 -- alpha_3 What I want to do is place the info from the column alpha_2 in the countries table into the alpha_2 column in the cc table. I have tried inner joins, left joins, Insert and Select index. Everything that I have tried gives me an error message. I do not know what I am doing wrong and I was hoping that someone would be able to give me a hand. I forgot to mention that I want the placement of the alpha_2 column to be based on the cn columns in both tables. So that the information in the alpha_2 column lines up with the right name in the cn column Edited August 9, 2014 by mdmartiny Quote Link to comment https://forums.phpfreaks.com/topic/290364-get-info-from-one-table-and-placing-it-into-another-one/ Share on other sites More sharing options...
Barand Posted August 9, 2014 Share Posted August 9, 2014 try UPDATE cc INNER JOIN countries USING (cn) SET cc.alpha2 = countries.alpha_2 Quote Link to comment https://forums.phpfreaks.com/topic/290364-get-info-from-one-table-and-placing-it-into-another-one/#findComment-1487253 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.