update table_a
set a_step_name=( select 
                   from table_b,table_c 
                   where table_b.b_flowid=table_c.c_flowid
                         and table_a.a_moudle = table_b.b_moudle 
                         and table_a.a_type=table_b.a_type 
                         and rownum <=1)

解决方案 »

  1.   

    更正一下楼上的:
    update table_a
    set a_step_name=( select c_step_name
                       from table_b,table_c 
                       where table_b.b_flowid=table_c.c_flowid
                             and table_a.a_moudle = table_b.b_moudle 
                             and table_a.a_type=table_b.a_type 
                             and rownum <=1)
      

  2.   

    更正一下楼上的:
    update table_a
    set a_step_name=( select c_step_name
                       from table_b,table_c 
                       where table_b.b_flowid=table_c.c_flowid
                             and table_a.a_moudle = table_b.b_moudle 
                             and table_a.a_type=table_b.a_type 
                             and rownum <=1)
      

  3.   

    "table_a和table_b多对一的关系
    table_b和table_c为一对多的关系."
    那么假设3个table_a的记录对应一个table_b记录,一个table_b记录对应10个table_c的记录.
    或者10个table_a的记录对应一个table_b记录,一个table_b记录对应3个table_c的记录.怎样把table_c的记录放入table_a?
      

  4.   

    不是任意取一个进行赋值,而是将table_c表中的c_step_name的值插入到table_a表中的a_step_name字段中去
      

  5.   

    对于楼上这样的更新对如果在A表中存在的数据,而B,C表中没有对应项的,在A表中a_step_name都会更新为NULL了.
    不知道楼主是否想要这样的结果?