There are two identical tables, let table1, table2, but one table is filled with data, and the second is only half. The tables have the following fields: id, user_id, youtube, ball.
In two tables, only the youtube field is filled in, in which the link to YouTube, i.e. The two tables contain user data: youtube, ball, the youtube field is already filled in the same two tables. This youtube field is like the key by which you now need to copy the ball field from table1 to table2.
The id, user_id fields differ in two tables; you cannot join tables with join.
In general, you need to do something like this query:
copy the field table1.ball to the field table2.ball, where table1.youtube = table2.youtube Tell me how to do this? if you send such a request:
SELECT * FROM `table1` t1 join `table2` t2 on t1.youtube=t2.youtube then, instead of the existing 30 lines, approximately 2000 lines will be returned. Of course, I know that you need to use update and probably nested select, but I haven’t yet figured out how to do it