I'm trying to insert a join into a table called students but I'm certain this is not the most efficient way of solving my question.
What I'm attempting to do is join the name column from the list table with the students table, with their student_id as a reference.
INSERT INTO students (name)
SELECT name
FROM list
JOIN students ON list.student_id = students.student_id;
But I'm getting
OperationalError: ambiguous column name: student_id
as an error. Any ideas? Thankyou
Aucun commentaire:
Enregistrer un commentaire