0

I am trying to insert theses values to my table student but I have an error

insert into student(first_name,last_name,student_number,professor_id) values(Eden,Yuan,323744573, select professor_id from PROFESSORS where professor_name = 'Chu ') 

I get an error

saying missing expression

1 Answer 1

2

you can use this way (assuming that professor_id is the column you need)

insert into student(first_name,last_name,student_number,professor_id) select 'Eden', 'Eden', 323744573, column_professor_id from PROFESSORS where professor_name = 'Chu ' ; 

(In your query is missing the column in the select )

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.