我正在尝试将这些值插入我的学生表但我有错误
insert into student(first_name,last_name,student_number,professor_id)
values(Eden,Yuan,323744573,
select professor_id from PROFESSORS where professor_name = 'Chu ')
我收到错误
说缺少表达
答案 0 :(得分:2)
您可以使用这种方式(假设教授_id是您需要的列)
insert into student(first_name,last_name,student_number,professor_id)
select 'Eden', 'Eden', 323744573, column_professor_id
from PROFESSORS where professor_name = 'Chu ' ;
(在您的查询中缺少选择中的列)