April 1st, 2012, 09:04 PM
I am trying to update a column based on another column in the same table (student table) and a column
from another table (school table)
set student_code =
from school_table l, student_table n
where l.school = n.schoolname)
I get the following error
ORA - 01427 Single-row subquery returns more than one row
Any help would be appreciated.
April 2nd, 2012, 03:22 PM
1) You do not need to repeat the table you are updating (student_table) in the join with the school_table.
2) You query from the school table is returning multiple rows, you need to make it return a single row per student.