我写的是
update student
set student.name = student1.name,
    student.id = student1.id
from student,student1
where student.int_id = student1.int_id;
这个句子在sql server 2000下完全通过,
就是在oracle通不过
提示原因是sql命令未正确结束
请问高手是什么原因?
或者还有其他方法?

解决方案 »

  1.   

    update student set (student.name,student.id)=(select student1.name,student1.id from student1 where student1.id=student.id) where student.id in (select student1.id from student1);
      

  2.   

    不可以这样写.
    update 语句是一句更新一个记录。insert 就可以批量
    insert into tab1 select * from tab2....
      

  3.   

    呵呵,Orale不支持那样写的语法,今天上午我也遇到了同样的问题
      

  4.   

    chanet(牧师) ,the syntax of Update command allow this format:
    update tablename t1 set (tablecolumn1,tablecolumn2,tablecolumn3)=(select tabcolumn1,tabcolumn2,tabcolumn3 from table2 t2 where t2.id=1) where t1.id in (1,2,3);
    I didn't mean that the update statement is a batch execute statement.
      

  5.   

    update student a set(name,id) = (select name,id from student1 where int_id = a.int_id) where a.int_id in (select int_id from student1);
      

  6.   

    update from 是SQL Server特有的,在ORACLE下不能用的。