解决方案 »

  1.   

    update  tableName   set  PARENT_ORDER =IS_ORDER  where 1=1;
      

  2.   

    update table_name a set a.PARENT_ORDER=(select b.id from table_name where a.PARENT_ORDER=b.IS_ORDER)
      

  3.   

    update tableName a, tableName b set a.PARENT_ORDER = b.ID where a.IS_ORDER = b.PARENT_ORDER;
      

  4.   


    update BU_COURSE_KNOWLEDGE a 
    set a.PARENT_ORDER=
    (select max(b.id) from BU_COURSE_KNOWLEDGE b where a.PARENT_ORDER=b.IS_ORDER) 
    WHERE a.COURESE_ID = '54a4ef8b1a6f4d1c8d7d9588a268d218' AND a.PARENT_ORDER !='0';
      

  5.   


    select max(b.id) from BU_COURSE_KNOWLEDGE b where a.PARENT_ORDER=b.IS_ORDER
     
    因为id是 varchar类型的,max取的不是第一条数据的ID,后来百度下,使用下面的方法可以实现,欢迎各位朋友提供其他高效率的实现方法:update BU_COURSE_KNOWLEDGE a 
    set a.PARENT_ORDER=
    (select x.id from(select s.id ,s.IS_ORDER,rownum num from(select t.id,t.IS_ORDER from BU_COURSE_KNOWLEDGE t where  order by t.IS_ORDER)s)x where x.IS_ORDER = a.PARENT_ORDER) ;