0

我正在尝试运行此查询错误,但它一直失败;不能在 from 子句中使用表。

update student s1 set tot_cred = (select total_cred from student s inner join taken t on s.id=t.id inner join transfer_course tc on (t.transfer_course_id, t.college_id) =   (tc.transfer_course_id, tc.college_id));

任何指针表示赞赏!

谢谢

4

2 回答 2

0
update student s1
set s1.tot_cred =
  (select total_cred
   from student s
   inner join taken t
   on s.id=t.id
   inner join transfer_course tc
   on (t.transfer_course_id = tc.transfer_course_id)
   AND (t.college_id = tc.college_id)
  );
于 2013-10-14T18:34:49.350 回答
0

试试这个:我不认为'on'关键字允许比较多个列。如果是这样,对我来说就是新闻

update student s1 
set tot_cred = (select total_cred 
                from student s 
                    inner join taken t 
                        on s.id=t.id 
                    inner join transfer_course tc 
                        on t.transfer_course_id = tc.transfer_course_id
                            and t.college_id = tc.college_id)
于 2013-10-14T18:33:19.433 回答