I have two tables:
`user1`
- full_name
- headline # this is empty
`user2`
- full_name
- headline # this has content
I want to insert the headline from user2 table into user1 table. This is what I have so far:
insert into user1 set headline = (select headline from user2 where headline=headline)
However, I get an error message from this saying the select returns more than one row. How would I correctly issue this insert statement?
It’s not entirely clear what you want to do. In particular, what happens when there are multiple records in each table? If you want to copy the headline from
user2intouser1where thefull_namematches, you can use the multiple-tableUPDATEsyntax to join the tables and updateuser1: