I have two tables: table 1 = university and table 2 = school
I added university_idto table 2 and I need to join two tables.
If university_namefrom table 1 and namefrom table 2 are identical, get idfrom table 1 and replace it with table 2university_id
I am very new to sql, so if you could explain that would be great. I also tried the following to no avail!
select a.id,b.name from university as a
inner join school as b on a.university_name = b.name
UPDATE `school` SET `university_id` = a.id WHERE a.university_name = b.name
source
share