I have two Table
one is student_record_temp
| id | name | roll |
|---|---|---|
| 1 | Shadman | 2 |
| 2 | Adnan | 3 |
Now I want to copy the row in student_record where the name is shadman and it returns both student_record_temp and student_record id
I am trying to solve this in
INSERT INTO student_record (name,rool) select name,roll from student_record_temp
FROM student_record_temp WHERE name='shadman' RETURNING student_record.id,student_record_temp.id
ERROR: missing FROM-clause entry for table "student_record_temp"
LINE 8: student_record.id,student_record_temp.id
but I got an error and how I can solve this.