MySQL How do you INSERT INTO a table with a SELECT subquery returning multiple rows?
问题 MySQL How do you INSERT INTO a table with a SELECT subquery returning multiple rows? INSERT INTO Results ( People, names, ) VALUES ( ( SELECT d.id FROM Names f JOIN People d ON d.id = f.id ), ( "Henry" ), ); I WANT to populate the new table with all results returning from this subquery. How do I do this without getting a ERROR 1242 (21000): Subquery returns more than 1 row 回答1: INSERT INTO Results (People, names ) SELECT d.id, 'Henry' FROM Names f JOIN People d ON d.id = f.id Combine the