noone wrote:
ph**************@gmail.com wrote: update student s set school_year_id = (select distinct s.id from
school_year s, interns i where lower(s.school_year_name) =
lower(i.enrollment_year)and s.unique_key = i.unique_key group by s.id);
ERROR 1242 (21000): Subquery returns more than 1 row
I am trying to replace a column in interns.student.school_year_id to
read an ID from the school_year table, where school_year_name will map
to interns.interns.enrollment_year
I can't for the life of me figure this one out, please help!
Thanx
Phil
can you post the definition of the tables in question?
table students:
id int not null auto_increment, primary key (id),
school_year_id int not null,
unique_key varchar(16) not null
table interns:
id int not null auto_increment, primary key (id),
enrollment_year varchar(80),
unique_key varchar(16) not null
table school_year:
id int not null auto_increment, primary key (id),
school_year_name varchar(50) not null
That's unfortunately all I'm allowed to give you, cannot give full
table definitions, we're not allowed here.
Phil