Reputation: 11
What is wrong with my following statement?
INSERT INTO studentenrolledteacher (student_id,teacher,subject) VALUES select student_id from studentprofile WHERE lastname='marco','1','2'
Upvotes: 1
Views: 45
Reputation: 1269773
You want insert . . . select
. Values
is not part of the syntax:
insert into studentenrolledteacher (student_id, teacher, subject)
select student_id, 1, 2
from studentprofile
where lastname = 'marco';
Upvotes: 2